Skip to content

fix(ai): rag index skips data fixtures and survives a failed batch - #6719

Merged
dan-petty merged 9 commits into
mainfrom
fix/6717-rag-index-skips-data
Nov 22, 2026
Merged

dan-petty merged 9 commits into
mainfrom
fix/6717-rag-index-skips-data

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

devops ai rag index leaves out each file that .gitattributes marks
linguist-vendored, read with one git check-attr call. Generated
files, such as the command reference, stay. The tiktoken fixtures are
marked vendored: a full index stopped on one of their batches.

EmbeddingsError holds the HTTP status of the reply. A batch with a
timeout, a 429 or a 5xx reply gets one more attempt. A 400, 413 or 422
reply gets none. The run skips such a batch, caches its files as
incomplete, indexes the other batches of both collections, and exits 1
with the skipped files. A pybreaker breaker stops the run after 3
failed batches in a row, or after the first one before any batch got
vectors. Any other error, such as 401, 403 or 404, ends the run at
once. The LiteLLM proxy answers an unknown model with 400 too, so a
second refused batch before an embedded batch also ends the run.

Closes #6717

Change: openspec/changes/archive/2026-11-22-6717-rag-index-skips-data/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/ai AI review pipeline, personas, prompts, LLM client, or RAG labels Nov 22, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Step after the merge

Owner review points

  1. Retry helper. The issue names "the bounded retry helper that src/devops_cli/ai/rag/investigator.py uses". The investigator has no retry helper: it uses the pybreaker CircuitBreaker (_LOOKUP_BREAKER), which pauses lookups and does not try them again. The indexer uses tenacity.Retrying (tenacity 9.1.4), as src/devops_cli/http/retry.py and src/devops_cli/k8s/informer.py do.
  2. More files leave the index than the issue names. On f14cb8b00, the index reads 46 files that .gitattributes marks linguist-generated: the 42 pages of docs/commands/, docs/CLI_REFERENCE.md, CHANGELOG.md (1 MB), tests/module_durations.json and .release-please-manifest.json. They leave devops_docs with this change. The command pages repeat the help text of src/devops_cli/lang/en/help.py, which devops_code keeps. If the command reference must stay in devops_docs, the rule needs an exception for it.
  3. Retry bound. A transient failure gets 2 attempts (one retry, first wait 10 s, at most 60 s). The embedder already tries each request 3 times with a batch timeout of up to 120 s, so one failed batch can hold the run for about 12 min. A third attempt would make it about 18 min.
  4. A permanent error still ends the run at once. An unserved or unknown model, a 4xx reply other than 408 and 429, or a malformed reply is not retried and not skipped. Reason: with an unserved model, a skip would send one failing request for each batch (about 1300 for 41385 chunks). A 400 reply for one batch, such as an input that is too long, also ends the run.
  5. Unrelated failure. The two review_window cases of tests/core/test_git_contract.py fail in the devcontainer with git 2.55.0, also on the base. fix(tests): pass the review_window git contract with git 2.55 #6380 tracks them; I added the evidence there.

…generated files

EmbeddingsError holds the HTTP status of the reply. A batch whose input
the endpoint refuses (400, 413, 422) is skipped at once. A transient
failure gets one more attempt, then the run skips it. Any other error
ends the run at once. The LiteLLM proxy answers an unknown model with
400 too, so a second refused batch before an embedded batch ends the
run. The indexer leaves out only linguist-vendored files.
A pybreaker circuit breaker of each index run counts the batches in a
row that fail both attempts with a transient error. After 3 such
batches, or after the first one before any batch of the run got
vectors, the run stops with exit status 1, the last error and the
skipped files, and sends no request for the later batches. A batch that
gets vectors, or whose input the endpoint refuses, sets the count back
to 0. A new test proves that a skipped code batch does not stop the
docs collection.
@dan-petty
dan-petty force-pushed the fix/6717-rag-index-skips-data branch from b40b80e to 477d709 Compare November 22, 2026 03:03
@dan-petty
dan-petty marked this pull request as ready for review November 22, 2026 04:07
@dan-petty
dan-petty merged commit 568475e into main Nov 22, 2026
44 of 46 checks passed
@dan-petty
dan-petty deleted the fix/6717-rag-index-skips-data branch November 22, 2026 04:09
dan-petty pushed a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.192.2](v0.192.1...v0.192.2)
(2026-11-22)


### Bug Fixes

* **ai:** rag index skips data fixtures and survives a failed batch
([#6719](#6719))
([568475e](568475e)),
closes [#6717](#6717)
* **k8s:** Tempo starts again with config keys of its version
([#6733](#6733))
([0cdd324](0cdd324)),
closes [#6730](#6730)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ai AI review pipeline, personas, prompts, LLM client, or RAG type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ai): rag index skips data fixtures and survives a failed batch

1 participant