Repository navigation
fix(nodes): keep paired-node photos and screenshots private by default - #174814
Conversation
Inspected node media (photos_latest, camera_snap, screen_snapshot) listed saved paths in details.media without the outbound:false privacy flag, so the reply pipeline auto-attached the image to the next visible reply even when the reply was text-only. Mark those results outbound:false — the contract already shipped for image, computer, and browser inspection results — and surface the saved paths in model-visible result text so explicit sharing still works when the user asks.
|
🦞👀 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 changes before merge. What this changesKeeps paired-node photos and screenshots out of automatic reply attachments while preserving saved paths for explicit sharing. Example: An agent inspects a receipt photo and answers “The receipt total is $42.” in Telegram group -100999888.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains This PR fixes a current privacy defect using the existing private-media contract; no introduced correctness or security defect was found. Priority: P1 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe nodes tool saves paired-device captures and returns model content plus media metadata; the agent reply pipeline consumes that metadata to prepare channel attachments. flowchart LR
A[Paired node] --> B[Nodes media producer]
B --> C[Private model result]
B --> D[Media extraction]
D --> E[Text reply delivery]
C --> F[Explicit message tool]
F --> G[Requested media delivery]
Technical reviewBest possible solution: Apply the existing private-media contract at node capture producers and retain explicit sharing through the message tool. Do we have a high-confidence way to reproduce the issue? Current-main producers omit outbound:false, allowing trusted node paths into automatic reply attachments; the supplied before/after transport trace corroborates this path without reviewer execution. Is this the best way to solve the issue? The patch repairs the producing owner with the established privacy flag and restores model-visible paths without changing capture authorization or explicit-send behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 88740b4ad834. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +24, Tests +250. Total +274 across 3 files. Added test files: 0. View PR surface stats
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 HistoryReview history (3 earlier review cycles)
Reviewed October 16, 2026, 11:26 PM ET / October 17, 2026, 03:26 UTC (Revision 4). |
…paths Only claim photos were loaded into private model context when retained image blocks survive sanitization; when modelHasVision is false or omitted, keep the saved-file text unchanged, and when sanitization omits an image block, report the saved path without claiming the model received the image. Add end-to-end group recipient isolation and explicit-share tests.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
# Conflicts: # src/agents/openclaw-tools.camera.test.ts # src/agents/tools/nodes-tool.test.ts
Merge recordSummary: Fixes a privacy leak where Decision Reason for Merge: Merged because Clawsweeper review completed with zero actionable findings and Compatibility Checks Done: Compatibility double-check on the three-dot diff vs |
openclaw#174814) * fix(nodes): keep paired-node photos and screenshots private by default Inspected node media (photos_latest, camera_snap, screen_snapshot) listed saved paths in details.media without the outbound:false privacy flag, so the reply pipeline auto-attached the image to the next visible reply even when the reply was text-only. Mark those results outbound:false — the contract already shipped for image, computer, and browser inspection results — and surface the saved paths in model-visible result text so explicit sharing still works when the user asks. * fix(nodes): distinguish retained vision images from saved-only photo paths Only claim photos were loaded into private model context when retained image blocks survive sanitization; when modelHasVision is false or omitted, keep the saved-file text unchanged, and when sanitization omits an image block, report the saved path without claiming the model received the image. Add end-to-end group recipient isolation and explicit-share tests. * test(nodes): fix details media type access in privacy tests
Summary
Paired-node media inspection results (
photos_latest,camera_snap,screen_snapshot) published their saved image paths indetails.mediawithout theoutbound: falseprivacy flag, so the reply pipeline auto-attached the image to the first visible reply — even a text-only answer, and even in group chats. This marks those resultsoutbound: false, the contract already shipped for image, computer, and browser inspection results, and surfaces the saved paths in model-visible result text for vision turns with accurate wording based on whether retained image blocks entered model context so explicit sharing still works without misleading non-vision or sanitized-omission runs.What Problem This Solves
What this Problem Solves
When the agent inspects a private device image via the
nodestool — the owner's latest gallery photo, a camera capture, or the current phone screen — the saved file was queued as reply media and attached to the first visible reply regardless of whether anyone asked for the image. In a group chat, that posts the private image to every member; a screen snapshot can carry banking apps, messages, or one-time-code screens. No prompt injection or attacker is needed: any tool-enabled agent with a paired node and a vision model on a direct-tool surface (tools.toolSearch: false, or releases before structured Tool Search defaulted on) can leak by answering a routine question about a photo.createNodePhotoResult(photos/camera results) and thescreen_snapshotcase ofexecuteNodeMediaAction, both insrc/agents/tools/nodes-tool-media.ts, builtdetails.mediawithoutoutbound.extractToolResultMediaArtifactinsrc/agents/embedded-agent-tool-media.ts(returningundefinedwhendetails.media.outbound === false), but these producers never set it. Becausenodesis inTRUSTED_TOOL_RESULT_MEDIA, local temp paths passedfilterToolResultMediaUrls, were queued inpendingToolMediaUrls, and merged into the first visible reply (src/agents/embedded-agent-runner/run/tool-media-payloads.ts) even when the reply text never referenced the image.modelHasVision: true),createNodePhotoResultemitted only animagecontent block and omitted the saved file path fromcontent, while non-vision runs (modelHasVision: falseor omitted) emitted"Camera/Library photo saved to <path>."and no image block. AftersanitizeToolResultImages,createNodePhotoResultnow inspects the sanitized content: when vision attempted inline images and retained image blocks survive (retainedImageCount > 0), it appends"Loaded <N> photo(s) into private model context for inspection; not attached or sent to the user. Saved to <paths>. Share explicitly only when the user asks."; when image sanitization omits the image block (retainedImageCount === 0), it appends"Photo(s) saved to <paths>; not attached or sent to the user. Share explicitly only when the user asks."without claiming the model received the image; and whenmodelHasVisionis false or omitted, it preserves the existing saved-file text unchanged.Net effect: inspecting paired-node photos, camera captures, or screen snapshots never implicitly attaches the private artifact to a group or direct reply, while explicit sharing via the
messagetool remains intact and model-facing text accurately reflects whether inline images entered context.Why this design
details.media.outbound: falseis consumed at a single already-shipped site and already marks image/computer/browser inspection results private; the nodes producers were the missing seam.sanitized.contentaftersanitizeToolResultImagesso the result claims photos were loaded into private model context only when retained image blocks actually survive (retainedImageCount > 0), reports saved-only paths when sanitization omits an image block, and leaves non-vision saved-file output untouched.screen_snapshotalready providesFILE:<path>, so explicit outbound sends via themessagetool (media/mediaUrl) continue to deliver to the intended recipient.Why this does not conflict with the sibling privacy fixes
extensions/browserscreenshot resultssrc/agents/tools/computer-tool-result.ts)outboundcontract consumed at the already-shipped site.src/agents/tools/image-tool.result.tsAll three are merged in the base branch; this PR composes with them through the same
details.media.outboundfield. This diff changes node producers and tests only — no pipeline or consumer files.Evidence of Fix
Production-path execution drives a real loopback Gateway server (
startGatewayServer), a connected WebSocket Android node (role: "node",commands: ["photos.latest", "camera.snap", "screen.snapshot"]) servicing realnode.invoke.request->node.invoke.resultframes,createNodesToolover WebSocket,handleToolExecutionEnd->buildEmbeddedRunPayloads->mergeAttemptToolMediaPayloads, and real channel delivery through bothprepareOutboundPayloadBatch+deliverOutboundPayloadsCoreand the Telegram plugin (deliverReplies+telegramPlugin.actions.handleActionagainst a loopback Telegram Bot API HTTP server on127.0.0.1:<redacted-port>for group chat-100999888) at exact headf78a9b7b95b667c4667f2cf64f1a949603abf850vs. merge-basec7a77fe791520c6f6dc76d090cf457a9bd55b7e5.c7a77fe7915)f78a9b7b95b)nodes photos_latest(modelHasVision: true, paired Android node over Gateway WS)"The receipt total is $42."to-100999888)details.mediaomitsoutbound; path queued inpendingToolMediaUrlsand auto-attached to group reply (6/55overlaid suite tests fail on base)details.media.outbound === false;pendingToolMediaUrls === []; Telegram HTTP server receives onlyPOST /bot<redacted>/sendMessage(hasPhotoUpload: false, 0sendPhotocalls); vision text reports"Loaded 1 photo into private model context for inspection; not attached or sent to the user. Saved to \"/tmp/openclaw/openclaw-camera-snap-<redacted>.jpg\"..."nodes camera_snap(modelHasVision: true,facing: "front")createNodePhotoResultbuilder (outboundabsent)details.media.outbound === false;pendingToolMediaUrls === []; 0 implicit media sends to group recipientsnodes screen_snapshot(modelHasVision: true)details.media.mediaUrlqueued and auto-attached (/tmp/openclaw/openclaw-screen-snapshot-<redacted>.jpg)details.media.outbound === false;pendingToolMediaUrls === [];FILE:<path>retained for explicit share; 0 implicit media sends to group recipientsnodes photos_latest(modelHasVision: false/ omitted, and sanitized-omission vision path)modelHasVision: falsereturns only[{ type: "text", text: "Library photo saved to /tmp/openclaw/openclaw-camera-snap-<redacted>.jpg." }]; sanitized-omission returns"Photo saved to \"/tmp/camera.jpg\"; not attached or sent to the user. Share explicitly only when the user asks."without claiming images entered contextmessagetoolaction: "send"/telegramPlugin.actions.handleActionwithmedia/mediaUrlset to saved path)-100999888deliverOutboundPayloadsCoredispatchessendMedia(deliveredMedia.length === 1,mediaUrl === photoPath) and Telegram HTTP server receivesPOST /bot<redacted>/sendPhoto(chatId: "-100999888",caption: "Here is the receipt you asked me to share.",hasPhotoUpload: true)src/agents/openclaw-tools.camera.test.ts+src/agents/tools/nodes-tool.test.ts)git worktree add --detachat merge-basec7a77fe7915vs. headf78a9b7b95b)c7a77fe7915f78a9b7b95bRedacted live Gateway + paired Android node + Telegram Bot API HTTP trace on head
f78a9b7b95b{ "invokedNodeCommands": [ "photos.latest", "camera.snap", "screen.snapshot", "photos.latest" ], "visionPhotoContentTypes": [ "image", "text" ], "visionPhotoText": "Loaded 1 photo into private model context for inspection; not attached or sent to the user. Saved to \"/tmp/openclaw/openclaw-camera-snap-<redacted>.jpg\". Share explicitly only when the user asks.", "nonVisionPhotoText": [ "Library photo saved to /tmp/openclaw/openclaw-camera-snap-<redacted>.jpg." ], "photoOutboundFlag": false, "snapOutboundFlag": false, "screenOutboundFlag": false, "pendingToolMediaUrlsAfterInspection": [], "inspectionTelegramCalls": [ { "method": "sendMessage", "chatId": "-100999888", "text": "The receipt total is $42.", "hasPhotoUpload": false } ], "explicitShareTelegramCalls": [ { "method": "sendPhoto", "chatId": "-100999888", "caption": "Here is the receipt you asked me to share.", "hasPhotoUpload": true } ] }Testing
pnpm exec vitest run src/agents/openclaw-tools.camera.test.ts src/agents/tools/nodes-tool.test.ts: 55/55 passed on headf78a9b7b95b(vs. 6 failed / 49 passed when overlaid on merge-basec7a77fe7915), covering:Loaded 1 photo into private model context...+outbound: false),modelHasVision: falseemits only"Library photo saved to ..."without claiming images were loaded +outbound: false),sanitizeToolResultImagesemits"Photo saved to ...; not attached or sent to the user..."without claiming images entered model context +outbound: false),createNodesTool->handleToolExecutionEnd->buildEmbeddedRunPayloads->mergeAttemptToolMediaPayloads->prepareOutboundPayloadBatch->deliverOutboundPayloadsCoredelivers only text togroup:family-chatwith zero media sends, while explicitcreateMessageToolaction: "send"withmedia: photoPathdelivers the image togroup:family-chat).pnpm exec vitest run src/agents/embedded-agent-runner/run/tool-media-payloads.test.ts src/agents/embedded-agent-subscribe.tools.test.ts src/cli/nodes-camera.test.ts: 82/82 passed.pnpm tsgo:core: clean (exit 0).