Repository navigation
fix: hydrate current turn image attachments - #84812
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 25, 2026, 12:51 PM ET / 16:51 UTC. Summary PR surface: Source +25, Tests -2. Total +23 across 2 files. Reproducibility: yes. source inspection gives a high-confidence reproduction path: current main ignores Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the focused hydration fix after maintainer review and required checks complete, keeping prompt image scanning scoped to the visible prompt. Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence reproduction path: current main ignores Is this the best way to solve the issue? Yes, this is the narrow maintainable fix: infer only current-turn image MIME hints for missing or generic binary metadata, preserve explicit non-image MIME values, and reuse the existing attachment resolver. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 5cfa577778df. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +25, Tests -2. Total +23 across 2 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
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Pearl Clawlet Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
619c152 to
c3f55a2
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
17fa98c to
a18a9ff
Compare
2671e7e to
e5cc701
Compare
|
@steipete would you pls review this pr? |
|
@steipete sorry to ping directly here. I noticed there have been a few pushes on this PR, and I wanted to share a bit more context from our side. We have seen this issue affect multiple Volcano Engine customers. After testing this PR, those customers confirmed that it resolves the problem for them. If it is convenient, could you help take a look and help us move this fix forward? One more question: is there currently any restriction on review approval or merge permissions for this repository? Happy to discuss and provide any additional context that would be helpful. Thanks! |
|
Verification before landing:
Thanks @marchpure! |
Root cause
Current inbound images from Feishu/IM can arrive with structured
MediaPathsbut without reliableimage/*MIME metadata. After #76659 limited prompt image scanning to the visible prompt, those images should be passed through the current-turn media path instead of being rediscovered by scanning reply/runtime context text.Fix
detectAndLoadPromptImagesscoped to the visible prompt; this does not restore runtime/reply context scanning.current-turn-images.ts, infer an image MIME from the current-turnMediaPath/MediaPathsextension only when the declared media type is missing or generic binary.application/pdf,audio/*, orvideo/*; those are not upgraded to images based on extension.resolveAgentTurnAttachmentspath;agent-turn-attachments.tsstays unchanged.Real behavior proof
MediaPathsbut noMediaTypesare hydrated as native image input instead of relying on prompt/runtime-context path scanning.b338d73c97, macOS, Node.js v22.22.2, pnpm/tsx from the repository install.resolveCurrentTurnImagesfromsrc/auto-reply/reply/current-turn-images.tswith a Feishu-like context containingMediaPaths: [imagePath],MediaWorkspaceDir, and noMediaTypes.{ "images": 1, "mimeType": "image/png", "imageOrder": [ "inline" ], "base64Length": 92 }image/pngand inline image order, proving the attachment no longer depends on scanning reply/runtime context text.Verification
PATH=/opt/homebrew/opt/node@22/bin:$PATH pnpm exec oxfmt --check --threads=1 src/auto-reply/reply/current-turn-images.ts src/auto-reply/reply/get-reply-run.media-only.test.tsPATH=/opt/homebrew/opt/node@22/bin:$PATH pnpm exec vitest run src/auto-reply/reply/get-reply-run.media-only.test.ts --testNamePattern "hydrates current image MediaPaths by extension" --reporter=verbosePATH=/opt/homebrew/opt/node@22/bin:$PATH pnpm exec vitest run src/auto-reply/reply/dispatch-acp.test.ts --testNamePattern "does not fall back to recent history images when the current turn has non-image media" --reporter=verbosePATH=/opt/homebrew/opt/node@22/bin:$PATH pnpm exec vitest run src/auto-reply/reply/get-reply-run.media-only.test.ts src/auto-reply/reply/agent-runner.media-paths.test.ts src/agents/pi-embedded-runner/run/attempt.spawn-workspace.context-engine.test.ts --reporter=verboseMediaTypes: ["application/pdf"]with a.pngpath returns{ "images": 0, "imageOrder": [] }.