Repository navigation
Description
What happened
My agents save a screenshot or a recording of the preview tab almost every time they check UI work, because they need the files later as evidence. preview_snapshot with save: true always writes to ~/.t3/userdata/browser-artifacts/ under a generated name like browser-screenshot-localhost-<time>-<id>.png. preview_recording_stop always writes to ~/.t3/userdata/attachments/ under a name built from the thread id. Neither tool takes a destination or a file name.
So after every save the agent runs a shell cp to put the file where it belongs and give it a name that says what it shows. On 2026-11-26 that was 25 extra copy calls across two agent sessions: 16 in one session over 17 minutes and 9 in another over 2 minutes. Each one is a tool round trip, and the names they pick by hand are the only way to tell the captures apart afterwards.
Diagnosis
- In
apps/server/src/mcp/toolkits/preview/tools.tson main,preview_snapshottakes onlytabId,includeImageandsave.preview_recording_stoptakes onlytabId. saveScreenshotinapps/server/src/mcp/McpHttpServer.tsalways builds the name asbrowser-screenshot-<site>-<time>-<uuid>.pngand joins it toconfig.browserArtifactsDir.- The recording handler in
apps/server/src/mcp/toolkits/preview/handlers.tspasses onlytransferToEnvironment: truetorecordingStop, so the file lands wherever the server claims it, underattachments.
What would help: an optional output path (or a file name plus directory) on preview_snapshot when save is set, and the same on preview_recording_stop. Limiting it to the thread's workspace or a temp directory would be fine for my use. The default location could stay as it is.
Steps to reproduce
- Run the desktop app with its local server and start an agent thread.
- Call
preview_open({ open: false, reuseExistingTab: false })and put any static content in the tab withpreview_evaluate. - Call
preview_snapshot({ save: true }). The result is{"url":"about:blank","screenshotPath":"~/.t3/userdata/browser-artifacts/browser-screenshot-site-<time>-<id>.png"}. There is no input to change that path. - Call
preview_recording_start, change the page, thenpreview_recording_stop. The result'spathis~/.t3/userdata/attachments/thread-delegated-task-command-…-mp4.mp4. There is no input to change it either. - To keep either file under a useful name, the agent has to copy it with a shell command.
Seen 2 of 2 in the run above.
Version
Seen in agent sessions on 0.1.13-nightly.20261125.5258. Reproduced on 0.1.14-nightly.20261129.5452. The tool inputs are the same on main today.
Environment
macOS 27.2.1 arm64, desktop app with local server, Claude Code agents, Electron 44.10.1
Evidence
# 0.1.14-nightly.20261129.5452, 2026-11-30 UTC
preview_snapshot {"save":true}
-> {"url":"about:blank","screenshotPath":"~/.t3/userdata/browser-artifacts/browser-screenshot-site-mx2xhwoo-8c465169.png"}
preview_recording_stop
-> {"path":"~/.t3/userdata/attachments/thread-delegated-task-command-…-mp4.mp4","mimeType":"video/mp4","sizeBytes":27170}
# agent sessions on 0.1.13-nightly.20261125.5258, 2026-11-26 UTC
# session A: 16 saved snapshots, 2 recordings, 16 copy calls (08:07 to 08:24)
08:07:24 preview_snapshot {"includeImage":true,"save":true}
08:07:32 Bash cp ~/.t3/userdata/browser-artifacts/browser-screenshot-<site>-<time>-<id>.png $E/<what-it-shows>.png
08:14:28 Bash cp …browser-artifacts/….png $E/….png; cp ~/.t3/userdata/attachments/thread-…-mp4.mp4 $E/….mp4
# session B: 17 saved snapshots, 9 copy calls (18:12 to 18:14)
18:12:54 Bash cp ~/.t3/userdata/browser-artifacts/browser-screenshot-localhost-<time>-<id>.png $E/ref-….pngRelated issues
#4321 (closed) let snapshots save to workspace paths. It was closed when orchestration V2 replaced the layer it built on, with a note that this was not a judgement on the change. #9261 and #10501 added save with the fixed browser-artifacts location. #35637 and #35649 cover the error message when that save fails. I found no open issue asking for a caller-chosen path.
Fix applied or workaround
Nothing changed on the machine. Agents copy each file with cp after saving it.
Activity
juliusmarminge commentedon Nov 30, 2026
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.