Code index: progress lost on failure, shared stop cancels other callers, any settings change starts a duplicate embedding run
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2
- Forks
- 2
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
riverqueue/river#1576 ·
Los mantenedores suelen responder en 1 día
-
[bug] A prompt queued during a run is assessed without its textPosiblemente ocupada @jwiegley la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DevMortimer/pi-warden#211 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
mattermost/compass-design#191 ·
Los mantenedores suelen responder en 1 día
-
Add unit tests for the organization admin role checkPosiblemente ocupada @SaffuSafwan la tomó hoy. Abiertoarea/core good first issue help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
elmohq/elmo#1095 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
HorusGoul/trizum#559 · 1 comentario ·
Los mantenedores suelen responder en 1 día