Repository navigation
fix(pdf): report incomplete long-document reads - #210
Conversation
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
I'll analyze this and get back to you. |
There was a problem hiding this comment.
All reported issues were addressed across 23 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
Approving.
Traces cleanly to the reported failure mode (59-page set stopping mid-document then getting confident whole-document answers). Fallback path now: bounded 10-page batches, recursive split on text_limit, per-chunk coverage accounting aggregated per file, status: "partial" propagated through toolMetas → decision-trace → reply payload → tool-failure-digest, and the model prompt is explicitly instructed not to claim document-wide absence. Native-provider path untouched, as the PR body states.
Type widening ("blocked" → "blocked" | "partial") is applied consistently across every consumer I checked (run.ts, normalize-tool-metas, handlers.tools, runtime-plan/types, reply-payload, agent-runner, agent-decision-trace, tool-failure-digest). coverage is optional on DocumentExtractionResult so third-party extractors keep working.
Regression coverage is real and hits the shapes that matter: complete 59-page read in 6 bounded batches, dense-batch text-limit split reaching 12/12, partial 20/59 with the no-absence-claim instruction, single-chunk partial path receiving the coverage instruction (the P1 fix in 297c570), partial excluded from completedToolCount (P2 fix), and recoveredEveryFailure refusing to fire when partialCalls > 0 (P2 fix). All 4 cubic threads resolved with regression tests. 162 focused tests reported passing, CI green, both commits signed.
SDK surface +2 is scoped and justified — the two exported types (DocumentExtractionCoverage, DocumentExtractionTruncationReason) are what external extractors need to type the new optional field.
No secrets in the diff (only the pre-existing PDF-decryption password request parameter). No backward-compat concerns. LGTM.
…218) Carries #210 (PDF fallback partial-read reporting) and #217 / ENG-18097 (cron delivery targets the channel disowns are rejected at resolution time). Lockstep regenerated via `pnpm release:prep` — 208 files. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

What Problem This Solves
Fixes an issue where users analyzing long PDFs could receive a confident whole-document answer after extraction stopped early at a page or text limit. In the reported shape, a 59-page construction set stopped around page 17 and later electrical/structural sheets could be described as absent.
Companion regression coverage: https://github.com/getboon/boon/pull/14642
Why This Change Was Made
Fallback PDF analysis now preserves extractor page-count/truncation metadata, reads within the configured page budget in bounded 10-page batches, recursively splits dense batches that hit the text ceiling, and synthesizes grounded chunk findings. Every fallback result reports processed pages; incomplete reads return
details.status: partial, emit structured diagnostics, and explicitly prohibit document-wide absence claims.The native-provider path is unchanged. This targets the extracted-content fallback used by Boon Agent.
User Impact
Users can see whether the PDF was read completely before trusting the findings. Common construction sets within the configured page budget are analyzed beyond the former first-chunk boundary, while genuinely incomplete reads are visibly labeled partial instead of appearing fully verified.
Release note: PDF fallback analysis now reports page coverage and warns when a long document was only partially read.
Evidence
Summary by cubic
Fixes PDF fallback analysis so long documents are read in bounded 10-page batches instead of stopping at the first extraction limit. Incomplete reads now report page coverage and return
details.status: partial, and the model is told not to claim omitted sheets are absent, so users no longer get a confident whole-document answer from a partial read.Extraction
coveragemetadata preserves page counts, processed pages, text limits, and truncation reasons; it is optional for third-party extractors.Status propagation
partialas a tool outcome status in tool summaries, decision traces, and auto-reply payloads.Written for commit 297c570. Summary will update on new commits.