Repository navigation
fix(media): inspect generated images with workspace-only tools - #197812
roboclaw-bot merged 4 commits into
Conversation
…ages With tools.fs.workspaceOnly, native image loading restricted localRoots to [workspaceDir], so images written to <stateDir>/media/tool-image-generation/ were rejected. Add getMediaDir() to the host allowlist, consistent with the outbound media rule. Fixes openclaw#197767
|
🦞👀 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 real behavior proof before merge. What this changesThis PR lets non-sandboxed workspaceOnly agents automatically load images anywhere in the Gateway media directory. Example: An agent with workspace /srv/openclaw/workspace receives a generated-image path /srv/openclaw/media/tool-image-generation/poster.png.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 3 items remain Keep open: this PR addresses a source-confirmed problem, but its global media-root exception also admits unrelated images through a deliberately restricted native-loading path. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe embedded runner discovers image paths in prompt text and hydrates admitted attachment facts, reads their bytes through media access controls, and supplies image blocks to the model provider. flowchart LR
A[Image generation] --> B[Gateway media store]
A --> C[Completion event]
C --> D[Prompt image loader]
E[Prompt text paths] --> D
D --> F[Local media access]
B --> F
F --> G[Model provider input]
Technical reviewBest possible solution: Carry the completion’s generated images through the existing admitted-attachment owner while keeping arbitrary prompt-discovered paths confined to the workspace. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that a non-admitted generated-image path outside the workspace is rejected when workspaceOnly is enabled; the linked report names an affected official version, but no runtime reproduction was executed during this review. Is this the best way to solve the issue? The one-line change reaches the reported host-loading case, but broadens permission beyond the requested generated-session images; the existing attachment handoff is the narrower repair boundary. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b46197029a3a. Provenance checked
TestingProof path: none. SecurityNeeds attention: The added root bypasses the documented workspace restriction for unadmitted images referenced in prompt text. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource 0. Total 0 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label 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 Reviewed November 12, 2026, 11:11 AM ET / 16:11 UTC. |
Admit the successful producer-owned image outputs through the existing completion-turn attachment path instead of widening workspace-only native image discovery. Preserve host delivery bookkeeping so inspection does not resend generated media. Related: openclaw#197767 Co-authored-by: vincentkoc <[email protected]>
…spection Preserve Alexi5000 original PR ancestry and issue credit. The original global media-root exception is superseded by the producer-owned completion attachment repair; the reviewed and tested candidate tree is unchanged. Co-authored-by: vincentkoc <[email protected]>
Integrate only the named landed dependency c4f355b. Resolve the four repeated identity overlaps using the already-reviewed feature bytes, retaining both duplicate predicates, delivery-mode identity, bounded discovery and the coherent identity test extraction. Producer #197812 remains outside this branch pending its required approval. Co-authored-by: vincentkoc <[email protected]>
Merge verified main 6b8bdec to repair the actual GitHub PR197812 view showing 1839 unrelated files. Preserve the original contributor ancestry and the scoped producer-owned image attachment repair. Production repair modules remain byte-identical; the auto-merged fixture retains main's removal of findDuplicate. Affected 123 tests, targeted types, lint, format, and fresh six-file AutoReview P0-P2 passed. This is comparison repair, not a main-freshness update or landing. Co-authored-by: vincentkoc <[email protected]>
|
Merged via squash.
|
Fixes #197767
What Problem This Solves
Fixes: an agent can generate an image but receive no image input to inspect its result when the generation completes.
User Impact
Successful image-generation completions provide their exact generated images to the follow-up agent turn, including with
tools.fs.workspaceOnlyenabled. Input admission stays separate from existing output-delivery bookkeeping, so inspection does not resend the generated files. Arbitrary prompt paths to unrelated media-store files remain outside workspace-only native discovery. No permission or configuration migration.Why This Change Was Made
The original proposal widened native prompt discovery to the entire Gateway media directory. This revision preserves that boundary: the generation owner binds the completion to its requester and admits only its successful output descriptor list through existing Gateway input-attachment admission. Unavailable image input produces explicit guidance not to claim inspection.
Original report and proposed fix by @Alexi5000. Scoped takeover and repair requested by @vincentkoc. Original contributor commit
a7c83e8a09637dd343c1916ad0022ceeecd9d33eremains in the branch ancestry; its global-root exception is not retained.Work sessions
Linked for team reference; these sessions aren’t public.
Evidence
7b75336…, head9a56b52…. After the normal merge/push, the PR metadata and complete PR files endpoint both report six files, +141/−1, base6b8bdec8314fee0db128b9be15f021f116ea1584, head448a1dfd014f82ee0f973fb801397217f29dc936. This was verified against the actual PR view/API, not inferred from a local three-dot diff.9a56b52fea3a52e2f607eeac346ac8b4e688e4f2and verified main6b8bdec…. This integration was specifically to repair the broken PR comparison, not merely for main freshness. No force-push, rebase, closure, or replacement PR. The merge carries Vincent’s required coauthor credit and preserves original contributor ancestry.9a56b52…. The conflict-free auto-merge keeps main’s removal of the retiredfindDuplicatetest-fixture property. Native image-discovery code remains unchanged; no second media-admission owner was introduced.6b8bdec…, P0–P2, completedscoped-cleanwith no actionable findings. It confirmed the scoped attachment repair and separate outbound bookkeeping; it did not independently certify remote PR comparison statistics. Those were separately read back from GitHub after push.943a6da6f110c46d17fb6d5f60bf7c24a742b87c. This is qualified producer-input integration evidence, not a newly executed live run on448a1df…, and does not itself claim full combined delivery success. The separate review-release/delivery work is tracked in feat: let agents review generated images before delivery #198227.448a1dfd014f82ee0f973fb801397217f29dc936, includingsecurity-fastandopenclaw/ci-gate. The current security-sensitive guard is cleared and the combined commit status reports success; the revised six-file comparison has no sensitive-product-change approval requirement.91046f7…and green with the repair while an unrelated image in the same generation directory remained rejected. Producer tests exclude paths from completion text/arbitrary media URLs. The earlier 169-test run and successful CI 43396504892 belong to prior head9a56b52…, not the new merge head.The coordinator released this independent producer-input repair after its integration proof and current-head gates qualified. Native maintainer landing retains exact-head, review, contributor-ancestry and current GitHub enforcement checks. No native filesystem-discovery permission is widened.
Focused post-merge command: