Repository navigation
feat(snapshot): add save_path to write the screenshot to a PNG file - #533
Merged
Jeomon merged 1 commit intoNov 2, 2026
Merged
Conversation
…ursorTouch#496) Screenshot and Snapshot only returned the image inside the tool result, so agents that need a file (OCR, QR decoding, frame diffs) had to take a second capture with another tool. An optional save_path now writes the same PNG that is returned and reports the absolute path in the response. - absolute paths only; ~ and environment variables are expanded - an existing directory or a trailing separator gets a timestamped name - missing parents are created; existing files are never overwritten - on Snapshot, save_path turns on use_vision
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Screenshot and Snapshot accept an optional
save_path. The same PNG returned in the result is written to disk and the absolute path is reported.~and environment variables are expandedsave_pathturns onuse_visionMotivation
Agents that need a file (OCR, QR decoding, frame diffs) had to take a second capture with another tool.
Fixes #496
Testing
Testing: Linux run with Windows-only modules stubbed (pytest, Python 3.14). tests/test_screenshot_save_path.py: 10 passed. Additions to tests/test_snapshot_display_filter.py need Windows (module not collectable on Linux, also on main). No new failures or collection errors compared with upstream main 7fd39b4 (on main the Linux harness has 6 known failures and 75 modules that cannot be collected without Windows). Also tested on a real Windows 11 desktop (LegionVins) with the Windows-only test modules and manual end-to-end runs.