Skip to content

fix(docscout): assemble requests within model context budgets - #83

Merged
wolfy-j merged 2 commits into
mainfrom
fix/docscout-context-budget
Nov 11, 2026
Merged

wolfy-j merged 2 commits into
mainfrom
fix/docscout-context-budget

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #61.

Docscout batches and selects document content against the resolved model card's context length minus reserved output. One documented estimate includes message framing, schemas and tools with a 25% safety margin. Oversized items do not block later smaller evidence, and requests known to exceed that estimate are rejected before dispatch. This covers mapping, summaries, generated contexts, scout turns, Deep, highlights, extraction, verification and embeddings.

Exhausted context and provider input-length rejections return non-retryable context_budget_exceeded errors. Partial context adds an informational context_budget_partial code without changing verification or rejection counts. Partial outlines are rebuilt instead of cached, and a failed support batch affects only its own fields. The UI distinguishes budget outcomes from document absence; its static assets rebuild through the make target.

Selected agents retain ownership of their conversation. Docscout passes complete instructions and user messages, rejects an instruction that exceeds available input, bounds each returned document-tool result to one quarter of available input with a truncation marker, and maps returned provider length errors. Unknown limits preserve request assembly and options. Provider tokenization can differ from the estimate.

Existing stored results remain readable; no setting, endpoint, registry identity or data shape is removed. Oversized requests can select less evidence or use more calls, increasing cost and latency.

Validation:

  • Red/green native regressions on SQLite and PostgreSQL, including the four follow-up corrections and complete instruction sizes with no available input.
  • Final GitHub module gates pass 353 tests on each engine; focused budget suites pass 33 tests on each engine.
  • UI typecheck and all 138 UI tests pass; native lint passes. The existing static bundle includes the budget error and partial-context labels; this follow-up changes no UI sources.
  • The refreshed browser guard fails before the summary fix and passes on both engines, distinguishing partial context, failed quote checks and exhausted context.
  • Coverage tests, scenario-map freshness and the UI guard audit pass in the accompanying regression change.

@wolfy-j
wolfy-j merged commit 238060e into main Nov 11, 2026
16 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant