Repository navigation
fix(docscout): batch extraction by estimated reply size - #77
Merged
Merged
Conversation
added 3 commits
November 11, 2026 00:45
Extraction batched fields by count only, so up to 20 fields with values and quotes shared one max_output_tokens limit; a cut reply failed every field of the call. Fields now fill a call while their estimated replies (value leaves, lists at five items, five quotes each, set from measured reply sizes) fit the output limit, with max_fields_per_call as an upper bound. A field whose estimated reply alone exceeds the limit fails with field_output_exceeds_budget, naming the setting to raise.
Merged
This was referenced Nov 11, 2026
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.
Extraction groups fields by count, so a combined reply can truncate and fail fields whose individual replies fit. Calls now split by a heuristic of each field's expected reply size while retaining the configured field-count cap.
Supersedes #63. Retains the original reply estimator, batching, shape tests and documentation with original authorship. The estimate only schedules batches: an oversized field runs alone, short actual replies succeed, empty passage sets retain their missing outcome, and real truncation follows the existing error path. The weights make no provider or workload accuracy guarantee. Splitting can increase calls, repeated input tokens, cost and latency for existing extractors; each call keeps the configured output allowance. Defaults and stored shapes remain unchanged.
Validation uses runtime v0.3.59a and fresh harness dependencies: