Repository navigation
fix: sandbox screenshots unavailable in managed project chats - #176199
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesResolve managed sandbox screenshot references through their session worktree while preserving message access, mount containment, and ticket revocation. Example: A managed project reply contains MEDIA:/workspace/.artifacts/proof/screenshot.png.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes a current screenshot-preview failure. The earlier mount-backing finding is resolved, and no actionable defect remains in the reviewed changes; required CI is still pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway assistant-media route accepts saved attachment references and reader credentials, resolves session-owned files, and returns authorized metadata, tickets, and image bytes. flowchart TD
A[Saved message reference] --> B[Gateway media route]
B --> C[Current reader and session policy]
C --> D[Workspace settlement owner]
D --> E[Sandbox mount verification]
E --> F[Safe file reader]
F --> G[Authorized metadata and bytes]
Technical reviewBest possible solution: Use the existing media, settlement, and mount owners to serve only the current conversation’s verified workspace backing. Do we have a high-confidence way to reproduce the issue? Current main resolves an absolute container reference as a host path; the linked report and supplied before/after browser evidence demonstrate the resulting unavailable preview without a new reviewer-run reproduction. Is this the best way to solve the issue? The change repairs namespace resolution at the media owner, settles pending project edits through the existing owner, and verifies visible backing before disclosure; the added helpers and tests serve distinct containment and revocation failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 15ae101a0d85. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +250, Tests +323, Docs +8. Total +581 across 12 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 18, 2026, 10:10 AM ET / 14:10 UTC (Revision 2). |
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: managed project conversations can preview their authorized sandbox screenshots. |
…aw#176199) Resolve saved screenshot references through the owning managed sandbox workspace while preserving message access and visible backing checks. Refs openclaw#176188.
What Problem This Solves
Screenshots generated inside a local Docker or Podman sandbox can appear unavailable in their managed project conversation because the saved container path does not identify a Gateway-host file.
Fixes #176188.
User Impact
Authorized readers can preview their project screenshots in the conversation. Existing session/message access, containment and revocation checks still apply; no settings or permissions are added.
Why This Change Was Made
The media reader resolves the original workspace reference through the current managed worktree and joins its existing settlement owner. Before serving bytes, the sandbox mount owner verifies that the visible backing still identifies that workspace. Obscured or unverifiable paths remain unavailable. Inspectable stopped containers retain preview support. Image reads never provision a sandbox.
The original message reference remains the attachment identity. Virtual-path tickets bind to the current workspace through an opaque value without exposing a host path. Relative sandbox references retain that same namespace through message association and ticket reads. Explicit host paths and inbound uploads keep their existing behavior.
Evidence
The real HTTP regression fails on the base for an existing image in an unsynchronized projection. The corrected route serves its metadata and image bytes and rejects unrelated readers and issued tickets after access withdrawal or workspace reassignment.
Remote validation passed: formatting/lint, the affected compiler graphs, and 213 tests across 12 owner/consumer files (121.41 seconds; one existing skip). A final workdir-normalization check passed all 32 mount-owner cases. An actual Docker probe passed workspace, tmpfs, bind-override and volume cases while both running and stopped: ordinary workspace backing remained readable and obscured backing was rejected.
The browser comparison uses real Gateway sandbox execution to create the PNG, then appends a synthetic saved reference through the Gateway. It checks metadata, exact image bytes, preview click/Escape and reload after the owned container stops. The browser uses an owner session; the real HTTP fixture separately verifies guest authorization. Podman engine execution and representative workspace latency are not covered.
The relative-reference correction validates 64 cases across four media suites; the final 18-case HTTP authority run took 29.87 seconds. Captures below are from
8aaf876; its absolute-reference rendering path is unchanged by the relative-reference correction.Visual evidence
Open and close the preview, then reload after stopping the container
[email protected]
Visual verification
8aaf876dfa09fe73de1ed81f6042b41ef4642ec3