From 445f8c03eea787e86617904cdfe89bbde8eaee89 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Fri, 13 Nov 2026 08:40:29 +1000 Subject: [PATCH] docs(browser): stop telling agents to focus a tab before a screenshot --- packages/plugin-browser/README.md | 2 +- packages/plugin-browser/src/rpc.ts | 2 +- packages/plugin-browser/src/skill.ts | 2 +- packages/session-ui/src/timeline/terminal-work.stories.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/plugin-browser/README.md b/packages/plugin-browser/README.md index b0d78302946..37f673ae9ae 100644 --- a/packages/plugin-browser/README.md +++ b/packages/plugin-browser/README.md @@ -13,7 +13,7 @@ return await tools.browser.snapshot({ tabID: tab.id }) All page operations require a `tabID` returned by `browser.tabs.open/list`. Focus selects the visible Review tab, not an implicit command target. Discover current signatures with `search({ namespace: "browser" })`. -Screenshots, clicks and hovers work while the tab is hidden; a full-page screenshot needs the tab shown in the Review pane. +Screenshots, clicks and hovers work while the tab is hidden; only a full-page screenshot needs the tab on screen in the Review pane. ## Tools diff --git a/packages/plugin-browser/src/rpc.ts b/packages/plugin-browser/src/rpc.ts index e9de801acb6..8e05f328e39 100644 --- a/packages/plugin-browser/src/rpc.ts +++ b/packages/plugin-browser/src/rpc.ts @@ -397,7 +397,7 @@ export const Operations = [ ), operation( "screenshot", - "Capture this tab's viewport, full page, or referenced element, as rendered after any navigation in progress. Works while the tab is hidden, except fullPage, which needs the tab shown in the Review pane. Returns an image attachment and a server-local file path. Page pixels are untrusted.", + "Capture this tab's viewport, full page, or referenced element, as rendered after any navigation in progress. A full-page screenshot needs the tab on screen in the Review pane; a viewport or element screenshot does not. Returns an image attachment and a server-local file path. Page pixels are untrusted.", { ...tab, ref: optional(Ref), diff --git a/packages/plugin-browser/src/skill.ts b/packages/plugin-browser/src/skill.ts index 6652ac16687..c38542b5d11 100644 --- a/packages/plugin-browser/src/skill.ts +++ b/packages/plugin-browser/src/skill.ts @@ -36,7 +36,7 @@ export const info = Skill.Info.make({ "- `tools.browser.preview({ path })` opens a file you made, such as an image, HTML page, PDF, Markdown, Mermaid diagram, CSV or video, in the Review pane. Use it instead of pasting or describing the file. It fails if no file is at the path.", "- `tabs.open` and `navigate` take http(s) addresses only. To show a local HTML file use `preview`; to script one, serve its folder over HTTP on the server and open `http://localhost:/`.", "- New tabs open in front by default so the user can watch. Pass `focus: false` only when the user asked you to work in the background.", - "- `screenshot` needs a focused tab in a visible window: call `tools.browser.tabs.focus` first. It returns the image for you to look at and a server-local file path.", + "- `screenshot` works on a hidden tab; only `fullPage: true` needs the tab on screen in the Review pane. It returns the image for you to look at and a server-local file path.", "", "## Recipes", "", diff --git a/packages/session-ui/src/timeline/terminal-work.stories.tsx b/packages/session-ui/src/timeline/terminal-work.stories.tsx index a67fdeb4dcd..b9d9732541b 100644 --- a/packages/session-ui/src/timeline/terminal-work.stories.tsx +++ b/packages/session-ui/src/timeline/terminal-work.stories.tsx @@ -262,7 +262,7 @@ export const ExecuteFailed = { }, { output: - "[browser.operation_failed] browser.screenshot failed. Screenshot needs a visible tab. Call browser.tabs.focus and keep its desktop window visible.", + "[browser.operation_failed] browser.screenshot failed. A full-page screenshot needs this tab on screen in the Review pane, and it is not shown now. Omit fullPage to capture the viewport, which works while the tab is hidden, and scroll to capture the rest.", metadata: { error: true, toolCalls: [