Skip to content

feat(snapshot): add save_path to write the screenshot to a PNG file - #533

Merged
Jeomon merged 1 commit into
CursorTouch:mainfrom
FaberVi:fix/issue-496-screenshot-save-path-v2
Nov 2, 2026
Merged

Jeomon merged 1 commit into
CursorTouch:mainfrom
FaberVi:fix/issue-496-screenshot-save-path-v2

Conversation

@FaberVi

@FaberVi FaberVi commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

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.

  • absolute paths only; ~ and environment variables are expanded
  • a directory or trailing separator gets a timestamped file name
  • missing parent folders are created; existing files are never overwritten
  • on Snapshot, save_path turns on use_vision

Motivation

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.

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: let Screenshot / Snapshot write the image to a file path

2 participants