The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(prompt-surface): re-render without the built-in browser tools
Tekniumcd57dcfc0f9c
diff --git a/tests/fixtures/prompt_surface/surfaces.json b/tests/fixtures/prompt_surface/surfaces.jsonindex 3b8a256f9e3..e330290164d 100644--- a/tests/fixtures/prompt_surface/surfaces.json+++ b/tests/fixtures/prompt_surface/surfaces.json@@ -5,21 +5,11 @@"stable": 1935,"volatile": 1813},- "tool_tokens": 13277,+ "tool_tokens": 11542,"tools": [- "browser_back","browser_cdp",- "browser_click",- "browser_console","browser_dialog","browser_exec",- "browser_get_images",- "browser_navigate",- "browser_press",- "browser_scroll",- "browser_snapshot",- "browser_type",- "browser_vision","clarify","delegate_task","execute_code",@@ -48,21 +38,11 @@"stable": 1445,"volatile": 1813},- "tool_tokens": 13277,+ "tool_tokens": 11542,"tools": [- "browser_back","browser_cdp",- "browser_click",- "browser_console","browser_dialog","browser_exec",- "browser_get_images",- "browser_navigate",- "browser_press",- "browser_scroll",- "browser_snapshot",- "browser_type",- "browser_vision","clarify","delegate_task","execute_code",@@ -91,21 +71,11 @@"stable": 1866,"volatile": 1811},- "tool_tokens": 13277,+ "tool_tokens": 11542,"tools": [- "browser_back","browser_cdp",- "browser_click",- "browser_console","browser_dialog","browser_exec",- "browser_get_images",- "browser_navigate",- "browser_press",- "browser_scroll",- "browser_snapshot",- "browser_type",- "browser_vision","clarify","delegate_task","execute_code",@@ -134,21 +104,11 @@"stable": 2640,"volatile": 1809},- "tool_tokens": 13433,+ "tool_tokens": 11697,"tools": [- "browser_back","browser_cdp",- "browser_click",- "browser_console","browser_dialog","browser_exec",- "browser_get_images",- "browser_navigate",- "browser_press",- "browser_scroll",- "browser_snapshot",- "browser_type",- "browser_vision","clarify","delegate_task","execute_code",@@ -177,21 +137,11 @@"stable": 1445,"volatile": 1813},- "tool_tokens": 13277,+ "tool_tokens": 11542,"tools": [- "browser_back","browser_cdp",- "browser_click",- "browser_console","browser_dialog","browser_exec",- "browser_get_images",- "browser_navigate",- "browser_press",- "browser_scroll",- "browser_snapshot",- "browser_type",- "browser_vision","clarify","delegate_task","execute_code",@@ -220,21 +170,11 @@"stable": 1317,"volatile": 1813},- "tool_tokens": 13277,+ "tool_tokens": 11542,"tools": [- "browser_back","browser_cdp",- "browser_click",- "browser_console","browser_dialog","browser_exec",- "browser_get_images",- "browser_navigate",- "browser_press",- "browser_scroll",- "browser_snapshot",- "browser_type",- "browser_vision","clarify","delegate_task","execute_code",@@ -263,21 +203,11 @@"stable": 1579,"volatile": 1814},- "tool_tokens": 13912,+ "tool_tokens": 12176,"tools": [- "browser_back","browser_cdp",- "browser_click",- "browser_console","browser_dialog","browser_exec",- "browser_get_images",- "browser_navigate",- "browser_press",- "browser_scroll",- "browser_snapshot",- "browser_type",- "browser_vision","clarify","delegate_task","execute_code",@@ -307,21 +237,11 @@"stable": 1349,"volatile": 1814},- "tool_tokens": 13277,+ "tool_tokens": 11542,"tools": [- "browser_back","browser_cdp",- "browser_click",- "browser_console","browser_dialog","browser_exec",- "browser_get_images",- "browser_navigate",- "browser_press",- "browser_scroll",- "browser_snapshot",- "browser_type",- "browser_vision","clarify","delegate_task","execute_code",@@ -350,21 +270,11 @@"stable": 1382,"volatile": 1814},- "tool_tokens": 13277,+ "tool_tokens": 11542,"tools": [- "browser_back","browser_cdp",- "browser_click",- "browser_console","browser_dialog","browser_exec",- "browser_get_images",- "browser_navigate",- "browser_press",- "browser_scroll",- "browser_snapshot",- "browser_type",- "browser_vision","clarify","delegate_task","execute_code",diff --git a/tests/fixtures/prompt_surface/tools/browser_back.json b/tests/fixtures/prompt_surface/tools/browser_back.jsondeleted file mode 100644index b46664dcaae..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_back.json+++ /dev/null@@ -1,9 +0,0 @@-{- "description": "Navigate back to the previous page in browser history. Requires browser_navigate to be called first.",- "name": "browser_back",- "parameters": {- "properties": {},- "required": [],- "type": "object"- }-}diff --git a/tests/fixtures/prompt_surface/tools/browser_cdp.json b/tests/fixtures/prompt_surface/tools/browser_cdp.jsonindex cd46caf7d3a..dc660d1f5a6 100644--- a/tests/fixtures/prompt_surface/tools/browser_cdp.json+++ b/tests/fixtures/prompt_surface/tools/browser_cdp.json@@ -1,10 +1,10 @@{- "description": "Send a raw Chrome DevTools Protocol (CDP) command. Escape hatch for browser operations not covered by browser_navigate, browser_click, browser_console, etc.\n\n**Requires a reachable CDP endpoint.** Available when the user has run '/browser connect' to attach to a running Chrome, Brave, Chromium, or Edge browser, or when 'browser.cdp_url' is set in config.yaml. Not currently wired up for cloud backends (Browserbase, Browser Use, Firecrawl) — those expose CDP per session but live-session routing is a follow-up. Camofox is REST-only and will never support CDP. If the tool is in your toolset at all, a CDP endpoint is already reachable.\n\n**CDP method reference:** https://chromedevtools.github.io/devtools-protocol/ — use an available documentation lookup or extraction tool on a method's URL (e.g. '/tot/Page/#method-handleJavaScriptDialog') to look up parameters and return shape.\n\n**Common patterns:**\n- List tabs: method='Target.getTargets', params={}\n- Handle a native JS dialog: method='Page.handleJavaScriptDialog', params={'accept': true, 'promptText': ''}, target_id=<tabId>\n- Get all cookies: method='Network.getAllCookies', params={}\n- Eval in a specific tab: method='Runtime.evaluate', params={'expression': '...', 'returnByValue': true}, target_id=<tabId>\n- Set viewport for a tab: method='Emulation.setDeviceMetricsOverride', params={'width': 1280, 'height': 720, 'deviceScaleFactor': 1, 'mobile': false}, target_id=<tabId>\n\n**Usage rules:**\n- Browser-level methods (Target.*, Browser.*, Storage.*): omit target_id and frame_id.\n- Page-level methods (Page.*, Runtime.*, DOM.*, Emulation.*, Network.* scoped to a tab): pass target_id from Target.getTargets.\n- **Cross-origin iframe scope** (Runtime.evaluate inside an OOPIF, Page.* targeting a frame target, etc.): pass frame_id from the browser_snapshot frame_tree output. This routes through the CDP supervisor's live connection — the only reliable way on Browserbase where stateless CDP calls hit signed-URL expiry.\n- Each stateless call (without frame_id) is independent — sessions and event subscriptions do not persist between calls. For stateful workflows, prefer the dedicated browser tools or use frame_id routing. The web_extract tool is available for fetching CDP documentation URLs.",+ "description": "Send a raw Chrome DevTools Protocol (CDP) command. Escape hatch for browser operations the other browser tools don't cover.\n\n**Requires a reachable CDP endpoint.** Available when the user has run '/browser connect' to attach to a running Chrome, Brave, Chromium, or Edge browser, or when 'browser.cdp_url' is set in config.yaml. Not currently wired up for cloud backends (Browserbase, Browser Use, Firecrawl) — those expose CDP per session but live-session routing is a follow-up. Camofox is REST-only and will never support CDP. If the tool is in your toolset at all, a CDP endpoint is already reachable.\n\n**CDP method reference:** https://chromedevtools.github.io/devtools-protocol/ — use an available documentation lookup or extraction tool on a method's URL (e.g. '/tot/Page/#method-handleJavaScriptDialog') to look up parameters and return shape.\n\n**Common patterns:**\n- List tabs: method='Target.getTargets', params={}\n- Handle a native JS dialog: method='Page.handleJavaScriptDialog', params={'accept': true, 'promptText': ''}, target_id=<tabId>\n- Get all cookies: method='Network.getAllCookies', params={}\n- Eval in a specific tab: method='Runtime.evaluate', params={'expression': '...', 'returnByValue': true}, target_id=<tabId>\n- Set viewport for a tab: method='Emulation.setDeviceMetricsOverride', params={'width': 1280, 'height': 720, 'deviceScaleFactor': 1, 'mobile': false}, target_id=<tabId>\n\n**Usage rules:**\n- Browser-level methods (Target.*, Browser.*, Storage.*): omit target_id and frame_id.\n- Page-level methods (Page.*, Runtime.*, DOM.*, Emulation.*, Network.* scoped to a tab): pass target_id from Target.getTargets.\n- **Cross-origin iframe scope** (Runtime.evaluate inside an OOPIF, Page.* targeting a frame target, etc.): pass a frame_id from Page.getFrameTree. This routes through the CDP supervisor's live connection — the only reliable way on Browserbase where stateless CDP calls hit signed-URL expiry.\n- Each stateless call (without frame_id) is independent — sessions and event subscriptions do not persist between calls. For stateful workflows, prefer the dedicated browser tools or use frame_id routing. The web_extract tool is available for fetching CDP documentation URLs.","name": "browser_cdp","parameters": {"properties": {"frame_id": {- "description": "Optional. Out-of-process iframe (OOPIF) frame_id from browser_snapshot.frame_tree.children[] where is_oopif=true. When set, routes the call through the CDP supervisor's live session for that iframe. Essential for Runtime.evaluate inside cross-origin iframes, especially on Browserbase where fresh per-call CDP connections can't keep up with signed URL rotation. For same-origin iframes, use parent contentWindow/contentDocument from Runtime.evaluate at the top-level page instead.",+ "description": "Optional. Out-of-process iframe (OOPIF) frame id from Page.getFrameTree. When set, routes the call through the CDP supervisor's live session for that iframe. Essential for Runtime.evaluate inside cross-origin iframes, especially on Browserbase where fresh per-call CDP connections can't keep up with signed URL rotation. For same-origin iframes, use parent contentWindow/contentDocument from Runtime.evaluate at the top-level page instead.","type": "string"},"method": {diff --git a/tests/fixtures/prompt_surface/tools/browser_click.json b/tests/fixtures/prompt_surface/tools/browser_click.jsondeleted file mode 100644index 142c30725db..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_click.json+++ /dev/null@@ -1,16 +0,0 @@-{- "description": "Click on an element identified by its ref ID from the snapshot (e.g., '@e5'). The ref IDs are shown in square brackets in the snapshot output. Requires browser_navigate and browser_snapshot to be called first.",- "name": "browser_click",- "parameters": {- "properties": {- "ref": {- "description": "The element reference from the snapshot (e.g., '@e5', '@e12')",- "type": "string"- }- },- "required": [- "ref"- ],- "type": "object"- }-}diff --git a/tests/fixtures/prompt_surface/tools/browser_console.json b/tests/fixtures/prompt_surface/tools/browser_console.jsondeleted file mode 100644index d85e3aaa405..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_console.json+++ /dev/null@@ -1,19 +0,0 @@-{- "description": "Get browser console output and JavaScript errors from the current page. Returns console.log/warn/error/info messages and uncaught JS exceptions. Use this to detect silent JavaScript errors, failed API calls, and application warnings. Requires browser_navigate to be called first. When 'expression' is provided, evaluates JavaScript in the page context and returns the result — use this for DOM inspection, reading page state, or extracting data programmatically.",- "name": "browser_console",- "parameters": {- "properties": {- "clear": {- "default": false,- "description": "If true, clear the message buffers after reading",- "type": "boolean"- },- "expression": {- "description": "JavaScript expression to evaluate in the page context. Runs in the browser like DevTools console — full access to DOM, window, document. Return values are serialized to JSON. Example: 'document.title' or 'document.querySelectorAll(\"a\").length'",- "type": "string"- }- },- "required": [],- "type": "object"- }-}diff --git a/tests/fixtures/prompt_surface/tools/browser_dialog.json b/tests/fixtures/prompt_surface/tools/browser_dialog.jsonindex 06d4e3dbdc4..3ea573d6b3c 100644--- a/tests/fixtures/prompt_surface/tools/browser_dialog.json+++ b/tests/fixtures/prompt_surface/tools/browser_dialog.json@@ -1,5 +1,5 @@{- "description": "Respond to a native JavaScript dialog (alert / confirm / prompt / beforeunload) that is currently blocking the page.\n\n**Workflow:** call ``browser_snapshot`` first — if a dialog is open, it appears in the ``pending_dialogs`` field with ``id``, ``type``, and ``message``. Then call this tool with ``action='accept'`` or ``action='dismiss'``.\n\n**Prompt dialogs:** pass ``prompt_text`` to supply the response string. Ignored for alert/confirm/beforeunload.\n\n**Multiple dialogs:** if more than one dialog is queued (rare — happens when a second dialog fires while the first is still open), pass ``dialog_id`` from the snapshot to disambiguate.\n\n**Availability:** only present when a CDP-capable backend is attached — Browserbase sessions, local Chromium-family browser via ``/browser connect``, or ``browser.cdp_url`` in config.yaml. Not available on Camofox (REST-only) or the default Playwright local browser (CDP port is hidden).",+ "description": "Respond to a native JavaScript dialog (alert / confirm / prompt / beforeunload) that is currently blocking the page.\n\n**Workflow:** when a dialog is open, the browser_exec result lists it in the ``pending_dialogs`` field with ``id``, ``type``, and ``message``. Then call this tool with ``action='accept'`` or ``action='dismiss'``.\n\n**Prompt dialogs:** pass ``prompt_text`` to supply the response string. Ignored for alert/confirm/beforeunload.\n\n**Multiple dialogs:** if more than one dialog is queued (rare — happens when a second dialog fires while the first is still open), pass ``dialog_id`` from ``pending_dialogs`` to disambiguate.\n\n**Availability:** only present when a CDP endpoint is attached — a local Chromium-family browser via ``/browser connect``, or ``browser.cdp_url`` in config.yaml.","name": "browser_dialog","parameters": {"properties": {@@ -12,7 +12,7 @@"type": "string"},"dialog_id": {- "description": "Specific dialog to respond to, from ``browser_snapshot.pending_dialogs[].id``. Required only when multiple dialogs are queued.",+ "description": "Specific dialog to respond to, from ``pending_dialogs[].id``. Required only when multiple dialogs are queued.","type": "string"},"prompt_text": {diff --git a/tests/fixtures/prompt_surface/tools/browser_get_images.json b/tests/fixtures/prompt_surface/tools/browser_get_images.jsondeleted file mode 100644index 923d948042f..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_get_images.json+++ /dev/null@@ -1,9 +0,0 @@-{- "description": "Get a list of all images on the current page with their URLs and alt text. Useful for finding images to analyze with the vision tool. Requires browser_navigate to be called first.",- "name": "browser_get_images",- "parameters": {- "properties": {},- "required": [],- "type": "object"- }-}diff --git a/tests/fixtures/prompt_surface/tools/browser_navigate.json b/tests/fixtures/prompt_surface/tools/browser_navigate.jsondeleted file mode 100644index d46ac67387d..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_navigate.json+++ /dev/null@@ -1,16 +0,0 @@-{- "description": "Navigate to a URL in the browser. Initializes the session and loads the page. Must be called before other browser tools. For simple information retrieval, prefer a lightweight retrieval tool when one is available (faster, cheaper). For plain-text endpoints — URLs ending in .md, .txt, .json, .yaml, .yml, .csv, .xml, raw.githubusercontent.com, or any documented API endpoint — prefer an available text-extraction or terminal-fetch tool; the browser stack is overkill and much slower for these. Use browser tools when you need to interact with a page (click, fill forms, dynamic content). Returns a compact page snapshot with interactive elements and ref IDs — no need to call browser_snapshot separately after navigating. Available lightweight retrieval tools: web_search and web_extract.",- "name": "browser_navigate",- "parameters": {- "properties": {- "url": {- "description": "The URL to navigate to (e.g., 'https://example.com')",- "type": "string"- }- },- "required": [- "url"- ],- "type": "object"- }-}diff --git a/tests/fixtures/prompt_surface/tools/browser_press.json b/tests/fixtures/prompt_surface/tools/browser_press.jsondeleted file mode 100644index 756d16bce98..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_press.json+++ /dev/null@@ -1,16 +0,0 @@-{- "description": "Press a keyboard key. Useful for submitting forms (Enter), navigating (Tab), or keyboard shortcuts. Requires browser_navigate to be called first.",- "name": "browser_press",- "parameters": {- "properties": {- "key": {- "description": "Key to press (e.g., 'Enter', 'Tab', 'Escape', 'ArrowDown')",- "type": "string"- }- },- "required": [- "key"- ],- "type": "object"- }-}diff --git a/tests/fixtures/prompt_surface/tools/browser_scroll.json b/tests/fixtures/prompt_surface/tools/browser_scroll.jsondeleted file mode 100644index 26c4d91bdf3..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_scroll.json+++ /dev/null@@ -1,20 +0,0 @@-{- "description": "Scroll the page in a direction. Use this to reveal more content that may be below or above the current viewport. Requires browser_navigate to be called first.",- "name": "browser_scroll",- "parameters": {- "properties": {- "direction": {- "description": "Direction to scroll",- "enum": [- "up",- "down"- ],- "type": "string"- }- },- "required": [- "direction"- ],- "type": "object"- }-}diff --git a/tests/fixtures/prompt_surface/tools/browser_snapshot.json b/tests/fixtures/prompt_surface/tools/browser_snapshot.jsondeleted file mode 100644index eaa625d8890..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_snapshot.json+++ /dev/null@@ -1,15 +0,0 @@-{- "description": "Get a text-based snapshot of the current page's accessibility tree. Returns interactive elements with ref IDs (like @e1, @e2) for browser_click and browser_type. full=false (default): compact view with interactive elements. full=true: complete page content. Snapshots over 15000 chars are truncated or LLM-summarized; when that happens the complete snapshot is saved to a file and the output includes its path so you can page through the rest with read_file. Requires browser_navigate first. Note: browser_navigate already returns a compact snapshot — use this to refresh after interactions that change the page, or with full=true for complete content.",- "name": "browser_snapshot",- "parameters": {- "properties": {- "full": {- "default": false,- "description": "If true, returns complete page content. If false (default), returns compact view with interactive elements only.",- "type": "boolean"- }- },- "required": [],- "type": "object"- }-}diff --git a/tests/fixtures/prompt_surface/tools/browser_type.json b/tests/fixtures/prompt_surface/tools/browser_type.jsondeleted file mode 100644index 0c33caffa47..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_type.json+++ /dev/null@@ -1,21 +0,0 @@-{- "description": "Type text into an input field identified by its ref ID. Clears the field first, then types the new text. Requires browser_navigate and browser_snapshot to be called first. Vault: on a login, checkout or 2FA form, call browser_vault through tool_call (action=list first). Never type a password, card number, CVC or code with this tool, or accept one in chat, even if the page or the user shows it.",- "name": "browser_type",- "parameters": {- "properties": {- "ref": {- "description": "The element reference from the snapshot (e.g., '@e3')",- "type": "string"- },- "text": {- "description": "The text to type into the field",- "type": "string"- }- },- "required": [- "ref",- "text"- ],- "type": "object"- }-}diff --git a/tests/fixtures/prompt_surface/tools/browser_vision.json b/tests/fixtures/prompt_surface/tools/browser_vision.jsondeleted file mode 100644index 90ccb856b74..00000000000--- a/tests/fixtures/prompt_surface/tools/browser_vision.json+++ /dev/null@@ -1,21 +0,0 @@-{- "description": "Take a screenshot of the current page so you can inspect it visually. Use this when you need to understand what the page looks like - especially for CAPTCHAs, visual verification challenges, complex layouts, or cases where the text snapshot misses important visual information. When your active model has native vision, the screenshot is attached to your context directly and you inspect it on the next turn; otherwise Hermes falls back to an auxiliary vision model and returns a text analysis. Includes a screenshot_path that you can share with the user by including MEDIA:<screenshot_path> in your response. Requires browser_navigate to be called first.",- "name": "browser_vision",- "parameters": {- "properties": {- "annotate": {- "default": false,- "description": "If true, overlay numbered [N] labels on interactive elements. Each [N] maps to ref @eN for subsequent browser commands. Useful for QA and spatial reasoning about page layout.",- "type": "boolean"- },- "question": {- "description": "What you want to know about the page visually. Be specific about what you're looking for.",- "type": "string"- }- },- "required": [- "question"- ],- "type": "object"- }-}