Code index: progress lost on failure, shared stop cancels other callers, any settings change starts a duplicate embedding run
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start with src/main/search/code_index.ts at runUpdate and update(), then inspect the cache invalidation listener in src/main/index.ts:124. Trace batching, shared callers’ abort signals and settings changes, and run the code-index tests or probes if available. Done means partial progress survives failures, one caller cannot cancel others, and unrelated settings changes do not trigger duplicate indexing.
索引モデルが issue の本文から書いたものです。
説明
Found in the 2026-10-07 code review and confirmed with probes.
Problems
- Nothing is saved until the end.
runUpdate(src/main/search/code_index.ts:204-261) embeds every batch before committing anything. A failure in the last batch (rate limit, a stoppedsearch_code) throws away every embedding already paid for. Probe: 70 files with the second batch failing →fileCount0. - One caller's stop cancels everyone.
update()(:102-111) shares one run, but the run uses only the first caller's signal and progress callback. If the first caller stops, the second fails withaborted. A later caller's stop does nothing. - Any settings change clears the cache.
settings.on('change', () => codeIndexes.clear())(src/main/index.ts:124) runs on every change, including theme, model and approval mode. A running update stays on the old instance. The nextsearch_code/index:statuscreates a second instance from the stale file and starts a second full embedding run of the same project. Both write the same file, and the last one to finish wins. The status bar shows "not indexing" while the first run continues.
Fix
- Commit each file's chunks after each batch, and call
writeJsonevery N batches and infinally. - Give the shared run its own
AbortController, aborted only when every waiting caller has aborted. Each caller races its own signal against the shared promise. - Clear the cache only when the OpenRouter key or endpoint changes.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Open-Earth-Foundation/CityCatalyst#3399 ·
メンテナーはふだん 2 日以内に返信
-
userReport
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
nkprasad12/morcus-net#631 ·
メンテナーはふだん 1 日以内に返信
-
fix(app): fail closed if GetGeneralSetting fails during initialization対応中かも @kalavt が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
nekko-labs/nekko-agent#1756 ·
メンテナーはふだん 1 日以内に返信
-
needs-area-label
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 2 日以内に返信