Repository navigation
An empty balance stops open extraction at the refused chunk, so the job fails once and raises the alert - #1118
Merged
WaylandYang merged 2 commits intoOct 9, 2026
Conversation
…ob fails once and raises the alert Closes deeplethe#1095 Signed-off-by: Asaf Shitrit <asafshitrit.dev@gmail.com>
WaylandYang
approved these changes
Oct 9, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thank you. This is the small fix we agreed on #1095: one arm in call_and_parse_one_chunk returns the refusal with its chain intact, and nothing outside the helper moves.
The test covers what the issue asked for: the third chunk is not called, the error is final at the first attempt, one llm.out_of_credit alert fires, and the chunk applied before the refusal stays. Thank you also for stating what the document looks like afterwards, including that this exit skips the end-of-run disambiguator refresh like the other errors in the loop.
Merging after the release sync that is in flight. Thanks again.
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.
Why
Closes #1095. Open extraction kept an
OutOfCreditrefusal as a string and moved to the next chunk, so the job used all 3 attempts and nollm.out_of_creditalert fired.What changes
call_and_parse_one_chunkreturns the error with its chain intact whenutopia_llm::out_of_creditfinds it, next to the no-chat-model case.unextractedstays a list of strings, and nothing outside the helper changes.Afterwards, chunks applied before the refusal stay in the graph with
extracted_atset. The document isfailed, with the refusal as itsgraph_error. The next run continues from the refused chunk. Like the other errors inside the chunk loop, this exit skips the end-of-runrefresh_disambiguators.How it was checked
A test in
extraction_open_out_of_credit_tests.rsuses a scripted endpoint and a real database. It extracts 3 chunks, and the endpoint refuses the second one. The third chunk is not called, the error ishopelessat attempt 1 of 3, and onellm.out_of_creditalert fires. The fact from chunk 0 stays, only chunk 0 hasextracted_at, and the document isfailed.The test fails on
devwithout the fix.Before review
git commit -s)cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepass