fix(imessage): stage remote media before understanding#87113
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 26, 2026, 10:26 PM ET / 02:26 UTC. Summary PR surface: Source +44, Tests +68. Total +112 across 2 files. Reproducibility: yes. Current main is source-reproducible: iMessage Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge Security Review detailsBest possible solution: Land this focused ordering fix with the regression test once required checks remain green, keeping remote staging in the existing Do we have a high-confidence way to reproduce the issue? Yes. Current main is source-reproducible: iMessage Is this the best way to solve the issue? Yes. Moving only AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 90653775a96f. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +44, Tests +68. Total +112 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 Frosted Merge Sprite Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
0ccd1b7 to
3e10811
Compare
|
@clawsweeper re-review Resolved the conflict by rebasing onto current main and removed the direct CHANGELOG.md edit as requested. The PR now only changes the runtime and regression test files. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Verification before merge: Behavior addressed: remote iMessage image attachments with MediaRemoteHost are staged into the local remote-cache before media understanding sees the path.
|
Summary
MediaRemoteHostis presentMediaStagedso the later pre-agent staging block does not retry the rewritten cache pathRoot cause
The iMessage remote-host path intentionally passes raw remote Mac attachment paths plus
MediaRemoteHostsostageSandboxMediacan SCP-fetch and rewrite them.getReplyFromConfigran media understanding before that staging step, so image analysis saw/Users/.../Library/Messages/Attachments/...and rejected it before SCP had a chance to cache the file locally.Real behavior proof
/Users/.../Library/Messages/Attachments/...path.stageSandboxMediaruntime withHOMEisolated to a temp OpenClaw setup. The scenario used an iMessageremoteHostconfig, a raw macOS Messages attachment path, and a temporary localscpwrapper that copied the remote-path fixture into the destination requested by OpenClaw.node --import tsx --input-type=moduleOpenClaw runtime probe from the PR checkout. The probe created a raw/Users/demo/Library/Messages/Attachments/ab/cd/photo.jpgattachment, setMediaRemoteHost=user@gateway-host, called the realstageSandboxMediaimplementation with iMessage remote attachment roots, then printed the path that media understanding would receive after the pre-understanding staging step..openclaw/media/remote-cache/.../photo.jpgpath before the handoff. The media-understanding input path was the local cache path, andrawRemotePathStillVisibleToUnderstanding=falseconfirms the failing raw/Users/...path no longer reaches the next step.Verification
node scripts/run-vitest.mjs src/auto-reply/reply/get-reply.message-hooks.test.ts src/auto-reply/reply.stage-sandbox-media.scp-remote-path.test.tspnpm exec oxfmt --check --threads=1 CHANGELOG.md src/auto-reply/reply/get-reply.ts src/auto-reply/reply/get-reply.message-hooks.test.tsgit diff --checkpnpm changed:lanes --json --base upstream/mainpnpm check:changed -- --base upstream/mainFixes #87089
Attribution note: if maintainers squash or rework this PR, please preserve author attribution or include
Co-authored-by: Andy Ye <[email protected]>.