fix(media): forward scanned PDF page images in chat turns#96568
fix(media): forward scanned PDF page images in chat turns#96568harjothkhara wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 24, 2026, 6:36 PM ET / 22:36 UTC. Summary PR surface: Source +85, Tests +131. Total +216 across 7 files. Reproducibility: yes. source-reproducible. Current main's chat file-extraction path can receive PDF-rendered images from extractFileContentFromSource but emits only a placeholder text block instead of forwarding image payloads. Review metrics: 1 noteworthy metric.
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:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land the narrow image-handoff approach after adding redacted real chat or high-fidelity runtime proof and updating the media-understanding docs to describe the new forwarded-image behavior. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. Current main's chat file-extraction path can receive PDF-rendered images from extractFileContentFromSource but emits only a placeholder text block instead of forwarding image payloads. Is this the best way to solve the issue? Yes, with proof and docs still needed before merge. The implementation reuses existing current-turn inline-image and ACP attachment plumbing rather than adding channel-specific PDF handling. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f2af052ceed9. Label changesLabel justifications:
Evidence reviewedPR surface: Source +85, Tests +131. Total +216 across 7 files. View PR surface stats
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
|
|
Closing this — the code is ready, but I can't satisfy its required proof gate, so I'm handing it off rather than leaving a stuck PR. State of the fix (verified independently):
Why I'm not pushing it to merge: the Handoff: if a maintainer can run the Mantis/live proof (a scanned PDF with a token present only in the rasterized page, confirming the model's reply quotes it), the diff here should clear the gate as-is. Closing to free my open-PR slot; happy for anyone equipped to take this over or for me to reopen if a proof path opens up. |
Closes #96541
What Problem This Solves
Fixes an issue where users sending scanned or image-only PDFs over chat channels would have extracted PDF page images dropped before the model saw them.
Why This Change Was Made
The chat media-understanding path now carries PDF-rendered page images as transient current-turn inline images while preserving the file context block. The normal agent-runner path consumes those images once to avoid duplicate prepare/run merges, and ACP dispatch forwards the same extracted images into ACP runTurn attachments.
OpenResponses behavior is unchanged.
User Impact
Scanned receipts, contracts, and image-only PDFs sent through chat channels can now reach vision-capable models as image inputs instead of only a placeholder.
Evidence
AI-assisted: yes. I used Codex to implement and review this change and understand the resulting diff.
Behavior addressed: scanned / image-only PDF page images extracted on chat channel path are forwarded to the model instead of dropped.
Real environment tested: local source checkout at commit 2cd82bd on branch oss/96541-scanned-pdf-images-chat, using the real media-understanding, current-turn image hydration, ACP dispatch, agent-runner, and OpenResponses test paths with mocked document extraction where the external PDF-render boundary is intentionally isolated.
Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/media-understanding/apply.test.tsnode scripts/run-vitest.mjs src/auto-reply/reply/current-turn-images.test.tsnode scripts/run-vitest.mjs src/auto-reply/reply/dispatch-acp.test.tsnode scripts/run-vitest.mjs src/auto-reply/reply/agent-runner-execution.test.tsnode scripts/run-vitest.mjs src/gateway/openresponses-http.server.file-only.test.tsgit diff --check/Users/harjothk/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/bin/python3 .agents/skills/autoreview/scripts/autoreview --mode local --prompt "Review fix for #96541 after addressing duplicate image merge and ACP dispatch gaps: scanned/image-only PDF extraction on chat path carries extracted PDF page images into inline image payloads for normal agent runner and ACP dispatch, consumes transient extracted images, and preserves existing OpenResponses behavior."Evidence after fix:
apply.test.tsnow verifies an image-only PDF extraction result populatesCurrentTurnImagesand no longer emits the old "images not forwarded" placeholder.current-turn-images.test.tsverifies extracted PDF page images merge into inline image payloads and are not merged twice across prepare/run passes.dispatch-acp.test.tsverifies ACP dispatch passes extracted PDF page images as runTurn attachments.Observed result after fix: all commands above passed; autoreview clean: no accepted/actionable findings reported.
What was not tested: I did not run a live Telegram, Slack, Discord, or WhatsApp send with a real scanned PDF; the local proof exercises the shared chat media-understanding, normal agent-runner, ACP dispatch, and sibling OpenResponses source paths.