AOSSIE-Org / AOSSIE-Org/Devr.AI

BUG : Repository indexing can get stuck in pending with no recovery path

オープン
#228 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
102
フォーク
137
PR マージ指標
30日以内にマージされた PR はありません

説明

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

## 📌 Issue Overview
While reviewing the repository indexing flow, I noticed that a repository can get permanently stuck in the pending state if the indexing process is interrupted (e.g. backend crash or network failure).

This results in users being blocked from re-indexing the repository, even though no indexing job may actually be running.

## 🎯 Expected Behavior
The user should be able to re-index the repo if the previous indexing is stuck in "pending" state.

## 🚨 Actual Behavior
The indexing flow in RepoService.index_repo() behaves as follows:

1. `status = completed` : Indexing is considered done.

2. `status = pending` :
Backend returns : “Repository indexing in progress. Please wait.”

3. `status = failed` : Backend resets state to pending and re-triggers `/analyze_repo`.

For a new repository :
A database row is inserted with `status = pending` and `/analyze_repo` is called.

If the backend crashes or the request never completes after this point, the repository remains in pending. Any subsequent indexing request will hit case (2) and be blocked indefinitely.

## 💡 Suggested Improvements
Treat pending as a retryable state, similar to failed.

- Allow re-indexing when `status = pending`.
- Reset state to pending.
- Clear any previous error.
- Re-trigger `/analyze_repo`.

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。