fix(server): prevent preview_snapshot from bricking sessions with oversized images #11624
Closed
Exotic209093(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/11624/head·opened View on GitHubShowing 4 changed files with 13 additions and 49 deletions (loading 1).
x
@@ -197,8 +197,8 @@
- // Output selection and saving are MCP-only; the browser still produces a complete snapshot.
- const { includeImage: _includeImage, save: _save, ...operationInput } = input ?? {};
+ // Saving is MCP-only; the browser still produces a complete snapshot.
+ const { save: _save, ...operationInput } = input ?? {};
@@ -119,15 +119,9 @@
- "Inspect a page before interacting. Pass tabId to inspect a specific tab; omit it to use this agent session's current tab. Returns page state, semantic elements, diagnostics, action history, and a PNG screenshot. Set includeImage=false for text-only output with the same page metadata. Set save=true to also write the PNG to disk and get screenshotPath back; embed that path in your reply as  so the user sees it. This is the only way to show the user a screenshot; the image in the tool result is not saved anywhere.",
+ "Inspect a page before interacting. Pass tabId to inspect a specific tab; omit it to use this agent session's current tab. Returns page state, semantic elements, diagnostics, action history, and screenshot metadata (mimeType, width, height); the screenshot itself is not embedded in the tool result. Set save=true to write the PNG to disk and get screenshotPath back; embed that path in your reply as  so the user sees it. This is the only way to show the user a screenshot.",
- includeImage: Schema.optional(
- Schema.Boolean.annotate({
- description:
- "Include the PNG image in the tool response. Defaults to true. Set false for text-only output.",
- }),
- ),