Repository navigation
Conversation
The preview branch of QAIndexProcessor.transform indexed all_documents[0] without checking that the split produced any chunks. A whitespace-only text, a blank/no-text PDF, or a URL-sourced image document therefore raised IndexError, which the indexing-estimate adapter surfaced as HTTP 500 'Knowledge indexing estimate failed: list index out of range' instead of an empty preview. Guard the preview on a non-empty chunk list, matching paragraph-mode preview and non-preview QA indexing, and add a regression test for an empty document. Co-Authored-By: Claude Code <[email protected]>
The other zero-chunk route is an empty extracted document list; the preview guard covers it through the same non-empty check. Pin it with a regression test, which fails with IndexError on the pre-fix code. Co-Authored-By: Claude Code <[email protected]>
This was referenced Nov 1, 2026
This was referenced Nov 10, 2026
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #45089 +/- ##
=======================================
Coverage 90.41% 90.41%
=======================================
Files 6334 6334
Lines 396668 396669 +1
Branches 79710 79711 +1
=======================================
+ Hits 358628 358633 +5
+ Misses 31933 31930 -3
+ Partials 6107 6106 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #45087
Summary
The preview branch of
QAIndexProcessor.transform()indexedall_documents[0]without checking that the split produced any chunks. A source with zero chunks — whitespace-only text, a blank/no-text PDF, or a URL-sourced image whose images are not persisted — therefore raisedIndexError, which the indexing-estimate adapter surfaced as HTTP 500Knowledge indexing estimate failed: list index out of rangeinstead of an empty preview.Screenshots
Not a UI change.
Checklist
main(3e2df10), the new tests fail withIndexError: list index out of range; with this change the fulltest_qa_index_processor.pyis 23/23, andpyreflystrict checking plusruff check/ruff format --checkare clean.documents=[], splitter returning no nodes, mixed sources, non-preview empty; the realIndexingEstimateAdapterreturnstotal_segments=0, preview=[], qa_preview=[]. Related suites 108 pass;ruff check,ruff format --checkclean.From Claude Code