fix(imessage): stage remote media before plugin dispatch#91803
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs maintainer review before merge. Reviewed June 23, 2026, 2:36 PM ET / 18:36 UTC. Summary PR surface: Source +137, Tests +387. Total +524 across 8 files. Reproducibility: yes. The linked issue plus current-main source show plugin-bound Codex claim metadata is built from raw remote iMessage media before dispatch-side staging, and the PR body supplies final-head terminal proof that the staged cache path reaches Codex after the fix. 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:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this dispatch-layer staging fix once maintainers accept the explicit pending-media hook contract; keep Codex consuming staged localImage paths and leave normal get-reply staging single-owner for non-plugin turns. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue plus current-main source show plugin-bound Codex claim metadata is built from raw remote iMessage media before dispatch-side staging, and the PR body supplies final-head terminal proof that the staged cache path reaches Codex after the fix. Is this the best way to solve the issue? Yes. Staging the dispatch hook copy before plugin-bound Codex claims is the right layer because Codex expects readable localImage paths; teaching Codex about remote macOS Messages paths would be channel-specific and less maintainable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a86ca4f4ba97. Label changesLabel justifications:
Evidence reviewedPR surface: Source +137, Tests +387. Total +524 across 8 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
|
3363914 to
3c32fcf
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
adf424b to
d1c4813
Compare
1205640 to
950a6f4
Compare
6446e7b to
9fedd5b
Compare
9fedd5b to
cdd1976
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@TurboTheTurtle the staged-path proof looks good and CI is green, thanks for pushing this through. Two things before it can land: 1. Drop the unrelated files. This PR should be only the iMessage staging fix. These three are unrelated scope bundled in to get the branch green and should move to their own PR(s):
They are fine changes on their own, but bundling CI fixes into a behavior PR makes the diff harder to reason about and to revert cleanly. Please split them out and rebase this branch down to the staging change plus its own tests. 2. Confirm the Is total omission the intended contract? #91744 suggested keeping the raw Mac path as original/debug metadata rather than dropping it. I would prefer the hook event still carry something (for example the original path under an |
cdd1976 to
4a0c2e3
Compare
4a0c2e3 to
3302341
Compare
|
Merged via squash.
|
Closes #91744.
What Problem This Solves
Remote iMessage attachments can arrive with
MediaRemoteHostand raw macOS Messages paths such as/Users/.../Library/Messages/Attachments/.... Plugin-bound Codex inbound claims could build metadata before OpenClaw staged those paths, so Codex could receive an unreadable remote Mac path instead of a local/cache image path.Summary
localImagepath instead of a raw remote Mac Messages attachment path.get-reply.message_receivedhooks where staging has not run, omit the livemediaPath/mediaUrlfields and includemediaStagingPending,mediaRemoteHost, andoriginalMedia*metadata so consumers can detect the pending remote-media contract.Evidence
Final head:
4a0c2e3fc8c76cfc32f656662650daf54737d0d1.Scenario executed: near-real remote iMessage
MediaRemoteHostruntime path using the realstageRemoteInboundMediaIfNeeded, message hook mapper, and Codex turn-input builder. The harness used an isolated OpenClaw state dir and an SCP-compatible local shim to simulate successful remote attachment transfer without exposing live Messages data.Proof harness:
node --import tsx --input-type=module <inline proof harness>.{ "prHeadSha": "4a0c2e3fc8c76cfc32f656662650daf54737d0d1", "scenario": "near-real remote iMessage MediaRemoteHost staging before plugin-bound Codex claim", "redactedOriginalRemoteMedia": { "provider": "imessage", "accountId": "default", "mediaRemoteHost": "openclaw-mac.example", "mediaPath": "/Users/redacted/Library/Messages/Attachments/AA/BB/photo.jpg", "mediaType": "image/jpeg" }, "stageResult": { "staged": true, "mediaStagedFlag": true, "cacheFileExists": true }, "pluginClaimMediaPath": "/var/folders/.../state/media/remote-cache/agent-main-imessage-direct-chat--2a3a4048/photo.jpg", "codexInput": [ { "type": "text", "text": "what is this?", "text_elements": [] }, { "type": "localImage", "path": "/var/folders/.../state/media/remote-cache/agent-main-imessage-direct-chat--2a3a4048/photo.jpg" }, { "type": "localImage", "path": "/var/folders/.../state/media/remote-cache/agent-main-imessage-direct-chat--2a3a4048/photo.jpg" } ], "checks": { "stagedBeforeCodexClaim": true, "codexReceivesLocalImage": true, "stagedPathIsRemoteCache": true, "rawMessagesPathVisible": false } }Observed result: the plugin-bound claim metadata is rewritten from the raw remote Mac attachment path to the staged remote-cache path before Codex input is built, and Codex receives
localImageentries for that staged cache path. The raw/Users/.../Messages/Attachments/...path does not reach Codex.What was not tested: a live remote Mac/iMessage conversation; the proof uses a near-real remote-host scenario with a local SCP shim to avoid requiring live private Messages credentials.
Validation
message_receivedpending-stage metadata contract.AI-assisted: yes.