fix(auto-reply): stage sandboxed workspace media#86531
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 25, 2026, 6:51 PM ET / 22:51 UTC. Summary PR surface: Source +24, Tests +42. Total +66 across 5 files. Reproducibility: yes. by source inspection: current main attempts sandbox media translation before absolute workspace staging when a sandbox root exists, which can drop a valid host workspace path. The PR adds focused regression coverage for that exact path. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the scoped workspace-media staging fix after maintainer acceptance of the security boundary and any desired live Telegram proof, while keeping HTML host-read support for a separate review. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: current main attempts sandbox media translation before absolute workspace staging when a sandbox root exists, which can drop a valid host workspace path. The PR adds focused regression coverage for that exact path. Is this the best way to solve the issue? Yes, the patch is a narrow fix because it stages only paths that resolve under the agent workspace, preserves outside-host-path blocking, and keeps HTML host-read denied. The remaining question is maintainer acceptance of the boundary and live Telegram proof, not a code repair. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 00f98095316a. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +24, Tests +42. Total +66 across 5 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
|
2b17025 to
b038b7a
Compare
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Gilded Merge Sprite Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
Sanitized proof/maintainer follow-up for ClawSweeper. No Telegram bot token, chat ID, user credential, private file content, or proprietary channel data is included here. I also did not upload any local file to Telegram from my workstation. Local staging proofSynthetic fixture only:
I invoked the patched Observed normalized/staged result: This verifies the patched code path stages an absolute workspace HTML media file into managed outbound media before delivery. Mantis statusThe required native Telegram Desktop proof did not fail because candidate delivery was observed broken. It failed because the Mantis proof environment was unavailable:
I attempted the safe GitHub-hosted retry paths and did not use local Telegram credentials:
Maintainer decision neededClawSweeper also flagged the intentional host-read MIME boundary change: validated
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Pushed Validation after the scope split:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Proof gate is now green on @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
|
Pre-merge maintainer proof for PR #86531. Behavior addressed: Telegram/local final-reply MEDIA paths under the agent workspace were dropped when a sandbox workspace existed, producing Media failed instead of staging the file for delivery. Real environment tested: local maintainer checkout on main, plus existing PR CI/proof on head 6b1fe51. Exact steps or command run after this patch:
Evidence after fix: diff check clean; merge-tree produced b2dd46cd7366b687f55f3a02314cf5fbfade20b0 with no conflicts; PR head CI/proof rollup inspected earlier was green for relevant lanes. Observed result after fix: absolute workspace media is staged before sandbox mapping, while outside-workspace host paths and file URLs remain blocked. HTML host-read remains denied and extension-declared .html fails closed before binary/media sniff fallback. What was not tested: I did not run a live Telegram Bot API send from the reporter environment; GitHub status endpoints intermittently hit secondary rate limits during landing, so I did not refresh the full check-run list after the last main fast-forward. |
Fixes #74061.
Summary
.htmlremains denied underhostReadCapabilitypending a separate security-boundary review, and extension-declared.htmlfiles fail closed instead of falling through to binary/media sniffing.request-to-observed-messagesource type and production typecheck stays green on currentmain.Real behavior proof
Behavior or issue addressed: Telegram/local final-reply
MEDIA:paths that point to files inside the agent workspace can be dropped when a sandbox workspace exists because sandbox path translation runs before the normal local staging path. The reported repro includes/home/openclaw/.openclaw/workspace/.../screenshot.pngand other local workspace files receiving onlyMedia failed.Real environment tested: Current OpenClaw PR worktree for
codex/74061-workspace-media-stagingon Ubuntu 24.04 with repository dependencies already installed.Exact steps or command run after this patch:
Observed result after fix: The reply media normalizer now stages
/Users/peter/.openclaw/workspace/reports/screenshot.pngto/tmp/outbound-media/screenshot.pngeven whenensureSandboxWorkspaceForSession()returns a sandbox workspace, instead of dropping the path before delivery. The outside-workspace host path case remains blocked.Security-boundary result after narrowing:
text/htmlwas removed from the host-read document allowlist. Valid local.htmlfiles now reject withpath-not-allowed, and binary-disguised.htmlfiles are explicitly blocked before media sniffing can treat them as another allowed media type. HTML host-read support should be reviewed separately if maintainers want it.What was not tested: I did not send a live Telegram Bot API message from the reporter's environment because those channel credentials are not available in this checkout. The proof exercises the production normalizer and host-read boundary code paths in the repository test harness.