Skip to content

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

Description

@dan-petty

Problem

Checked on 2026-11-22 (main 8af846c), in a full reindex after the embedding model name changed to local/qwen3-embedding:0.6b.

  • devops ai rag index --include-kb stopped at 24576 of 41385 code chunks: Failed to embed batch from 'tests/fixtures/tiktoken/o200k_base.tiktoken' ...: ReadTimeout. Collection devops_docs stayed empty, because the run ends before the docs phase.
  • Cause 1: the indexer embeds data files. _is_indexable_file (src/devops_cli/ai/rag/indexer.py:110-134) leaves out lock files, hidden files, git-ignored files and files over 50 MB (DEFAULT_MAX_AST_FILE_SIZE_BYTES, a DoS limit). The two tiktoken vocabularies in tests/fixtures/tiktoken/ (1.7 MB and 3.6 MB of base64 tokens) pass, and give thousands of chunks with no meaning for a search.
  • Cause 2: one failed batch ends the run. The upsert loop (src/devops_cli/ai/rag/indexer.py:1094-1122) raises EmbeddingsError on the first exception of embed_texts, with no retry and no skip, so no file after that batch gets indexed.

Proposed remedy

  • Leave out each file that .gitattributes marks linguist-generated or linguist-vendored, read with git check-attr. The repository already marks uv.lock and package-lock.json this way. Mark the tiktoken fixtures linguist-vendored: they are data of tiktoken.
  • Retry a failed batch with the bounded retry helper that src/devops_cli/ai/rag/investigator.py uses, then skip the batch, record its files, index the other batches, and exit 1 at the end with the list of the skipped files.
  • Write the tests first: a file marked linguist-vendored is not indexed; with an embedder fake that fails one batch on each try, the run indexes the other batches, names the skipped files and exits 1.

Acceptance criteria

  • The new tests pass with uv run devops ci test on the indexer tests.
  • After the merge, devops ai rag index --include-kb completes on this repository, and devops ai rag status shows points in devops_code and devops_docs.

Dependencies

None.

Activity

  1. added
    type/bug
    scope/ai
    source/agent
    status/new
    on Nov 22, 2026
  2. dan-petty commented on Nov 22, 2026

    @dan-petty
    OwnerAuthor
  3. added
    value/medium
    effort/medium
    priority/p2-medium
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 22, 2026
  4. added
    status/in-review
    and removed
    status/in-progress
    on Nov 22, 2026
  5. removed
    status/in-review
    owner/agent
    on Nov 22, 2026
  6. added a commit that references this issue on Nov 22, 2026
  7. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor
  8. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-22 04:36 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/aisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions