From 014de0ec21936a7a2fd64db9d151e73c79bb44ad Mon Sep 17 00:00:00 2001 From: Patrick Barattin Date: Sun, 11 Oct 2026 20:25:38 +0200 Subject: refactor: remove duplicate browser prompt instructions (#35) Remove browser instruction text repeated across tool descriptions, parameter schemas, tool guidelines and the global browser prompt. Tool names, schemas, handlers and concurrency are unchanged; shared recovery and ownership guidance is now available before and after the browser connects, and the prompt names which tools are serialized versus observations. Co-Authored-By: Claude Fable 5.1 --- src/domains/snapshot.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/domains/snapshot.ts') diff --git a/src/domains/snapshot.ts b/src/domains/snapshot.ts index 86c5fe3..68f49b4 100644 --- a/src/domains/snapshot.ts +++ b/src/domains/snapshot.ts @@ -98,10 +98,7 @@ export const snapshotTool = defineBrowserTool({ "DEFAULT tool for understanding what is on the page. Returns the structured accessibility tree (roles, names, states, hierarchy). Every interactive element gets a stable ref shown as [eN] plus click coordinates @(x,y). Pass the ref to browser_click/browser_fill/etc. — refs survive re-renders, coordinates don't. Use this BEFORE deciding whether you need a screenshot. Pair with browser_execute_js for surgical reads of specific element values.", promptSnippet: "Get accessibility-tree snapshot with stable element refs (default for page inspection)", promptGuidelines: [ - "DEFAULT — use this whenever you need to know what's on a page, what's clickable, or how the page is structured.", - "Refs come for free: every interactive element shows '[eN]' in the outline. Pass eN as `ref` to browser_click/browser_fill/browser_select_option/browser_focus/browser_upload_file — refs survive re-renders, so prefer them over the '@(x,y)' coordinates (a fallback).", - "DO NOT call browser_screenshot just to understand the page. This tool already gives you structure, labels, states, refs, and click targets.", - "Re-run after a navigation or a major re-render to get fresh refs; a 'ref is stale' error from an interaction tool means you need a new snapshot.", + "Re-run browser_snapshot after a navigation or a major re-render to get fresh refs.", "Pass includeScreenshot:true ONLY if you also need to verify visual rendering (rare).", "format:'json' returns the raw slim structure (with `ref` and `box` per node) for programmatic use; default 'outline' is human/LLM-readable.", ], -- cgit v1.2.3