mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
docs(browser): stop telling agents to focus a tab before a screenshot
This commit is contained in:
parent
a7a65bd01e
commit
445f8c03ee
4 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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:<port>/`.",
|
||||
"- 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",
|
||||
"",
|
||||
|
|
|
|||
|
|
@ -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: [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue