fix: scanned PDF pages reach chat vision models#97354
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 27, 2026, 11:53 PM ET / 03:53 UTC. Summary PR surface: Source +227, Tests +200, Docs 0. Total +427 across 15 files. Reproducibility: yes. Source inspection reproduces the bug path with high confidence: current main and v2026.6.10 receive PDF page images from extraction but the chat media-understanding result only forwards a placeholder text block. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical typed image-forwarding fix that preserves current image, described-media, and recent-history semantics, then close the duplicate candidate PRs and the linked bug from the merged implementation. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection reproduces the bug path with high confidence: current main and v2026.6.10 receive PDF page images from extraction but the chat media-understanding result only forwards a placeholder text block. Is this the best way to solve the issue? Yes. The typed extractedFileImages handoff through existing normal and ACP image payload paths is the right fix shape; the remaining question is which overlapping branch maintainers want to land. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 830467bc9306. Label changesLabel justifications:
Evidence reviewedPR surface: Source +227, Tests +200, Docs 0. Total +427 across 15 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
13fcd41 to
7082091
Compare
* fix: forward scanned PDF page images to chat models * fix: remove stale reply option cast
* fix: forward scanned PDF page images to chat models * fix: remove stale reply option cast
* fix: forward scanned PDF page images to chat models * fix: remove stale reply option cast
* fix: forward scanned PDF page images to chat models * fix: remove stale reply option cast
Closes #96541
AI-assisted by Codex.
What Problem This Solves
Fixes an issue where users sending scanned or image-only PDFs through chat channels would have those rendered PDF page images extracted by media understanding but silently dropped before the reply model saw them.
The affected workflow is chat-channel replies with file attachment extraction enabled, especially scanned PDFs that have no extractable text and need vision input.
Why This Change Was Made
This threads rendered PDF page images from media-understanding file extraction into the normal reply image pipeline instead of treating them as text-only extraction side effects. It preserves attachment ordering across described media, rendered file pages, and native current-turn images, and applies the same behavior to the ACP dispatch path.
The stale placeholder that said rendered PDF images were not forwarded is removed from runtime output and docs. Local PDF extraction also now honors the existing input-file timeout limit so a stalled extraction path does not hang indefinitely.
User Impact
Users can attach scanned or image-only PDFs in chat channels and expect vision-capable reply models to receive the rendered pages. The model now has access to the actual PDF page images instead of only seeing a placeholder that the PDF was rendered.
Evidence
pnpm test src/auto-reply/reply/get-reply.message-hooks.test.ts src/media/input-files.fetch-guard.test.ts src/media/pdf-extract.test.ts extensions/document-extract/document-extractor.test.ts src/media-understanding/apply.test.ts src/media-understanding/media-understanding-misc.test.ts src/auto-reply/reply/current-turn-images.test.ts src/auto-reply/reply/agent-runner.media-paths.test.ts src/auto-reply/reply/dispatch-acp.test.ts -- --reporter=dotpassed 5 Vitest shards / 281 tests.git diff --checkpassed.pnpm changed:lanes --jsonreportedcore,coreTests, anddocs.pnpm check:changedpassed on Blacksmith Testboxtbx_01kw3ve1hw53mx08yn0t05egst(swift-crayfish), exit 0. This covered the code/test diff before the final docs-only edit.pnpm docs:listandpnpm docs:check-mdx.cbx_38ab3f65a3e0, runrun_ee855ee7e830: rendered PDF fallback producedimageCount=1, placeholder[PDF content rendered to images], and no staleimages not forwardedplaceholder.cbx_19bc9a4ae812, runrun_fb1b4f306692: real Telegramtelegramcredential, sent scanned PDF message25170, and observedLIVE_PROOF_PASS issue=96541 transport=telegram credentialKind=telegram imageInputCount=1.