Skip to content

The agent that grows with you

test(prompt-surface): re-render for the browser_exec/memory/search_files/skill_view trims

Tekniumdc29cc27a546
diff --git a/tests/fixtures/prompt_surface/surfaces.json b/tests/fixtures/prompt_surface/surfaces.json
index 7f28e287fd5..fa37c104cde 100644
--- a/tests/fixtures/prompt_surface/surfaces.json
+++ b/tests/fixtures/prompt_surface/surfaces.json
@@ -1,11 +1,11 @@
{
"cli-code.claude": {
"prompt_tokens": {
- "context": 134,
- "stable": 1829,
- "volatile": 1528
+ "context": 249,
+ "stable": 1935,
+ "volatile": 1813
},
- "tool_tokens": 11490,
+ "tool_tokens": 11255,
"tools": [
"browser_cdp",
"browser_dialog",
@@ -35,10 +35,10 @@
"cli.claude": {
"prompt_tokens": {
"context": 0,
- "stable": 1225,
- "volatile": 1528
+ "stable": 1445,
+ "volatile": 1813
},
- "tool_tokens": 11490,
+ "tool_tokens": 11255,
"tools": [
"browser_cdp",
"browser_dialog",
@@ -68,10 +68,10 @@
"cli.gemini": {
"prompt_tokens": {
"context": 0,
- "stable": 1646,
- "volatile": 1527
+ "stable": 1866,
+ "volatile": 1811
},
- "tool_tokens": 11490,
+ "tool_tokens": 11255,
"tools": [
"browser_cdp",
"browser_dialog",
@@ -101,10 +101,10 @@
"cli.gpt": {
"prompt_tokens": {
"context": 0,
- "stable": 2420,
- "volatile": 1524
+ "stable": 2640,
+ "volatile": 1809
},
- "tool_tokens": 11646,
+ "tool_tokens": 11411,
"tools": [
"browser_cdp",
"browser_dialog",
@@ -134,10 +134,10 @@
"cli.hermes": {
"prompt_tokens": {
"context": 0,
- "stable": 1225,
- "volatile": 1528
+ "stable": 1445,
+ "volatile": 1813
},
- "tool_tokens": 11490,
+ "tool_tokens": 11255,
"tools": [
"browser_cdp",
"browser_dialog",
@@ -167,10 +167,10 @@
"cron.claude": {
"prompt_tokens": {
"context": 0,
- "stable": 1211,
- "volatile": 1528
+ "stable": 1317,
+ "volatile": 1813
},
- "tool_tokens": 11490,
+ "tool_tokens": 11255,
"tools": [
"browser_cdp",
"browser_dialog",
@@ -200,10 +200,10 @@
"desktop.claude": {
"prompt_tokens": {
"context": 0,
- "stable": 1473,
- "volatile": 1529
+ "stable": 1579,
+ "volatile": 1814
},
- "tool_tokens": 12156,
+ "tool_tokens": 11921,
"tools": [
"browser_cdp",
"browser_dialog",
@@ -234,10 +234,10 @@
"discord.claude": {
"prompt_tokens": {
"context": 0,
- "stable": 1244,
- "volatile": 1529
+ "stable": 1349,
+ "volatile": 1814
},
- "tool_tokens": 11490,
+ "tool_tokens": 11255,
"tools": [
"browser_cdp",
"browser_dialog",
@@ -267,10 +267,10 @@
"telegram.claude": {
"prompt_tokens": {
"context": 0,
- "stable": 1276,
- "volatile": 1529
+ "stable": 1382,
+ "volatile": 1814
},
- "tool_tokens": 11490,
+ "tool_tokens": 11255,
"tools": [
"browser_cdp",
"browser_dialog",
diff --git a/tests/fixtures/prompt_surface/tools/browser_exec.json b/tests/fixtures/prompt_surface/tools/browser_exec.json
index f202b36e6d2..a20ce32a949 100644
--- a/tests/fixtures/prompt_surface/tools/browser_exec.json
+++ b/tests/fixtures/prompt_surface/tools/browser_exec.json
@@ -1,5 +1,5 @@
{
- "description": "Drive a real browser for JS pages, logins, forms and clicks (Browser Use CLI). `code` runs as full Python (stdlib available) with pre-imported browser helpers; stdout comes back in the result. Start `code` with a one-line comment describing the step for the user in plain language, max 60 chars (e.g. `# Searching Amazon for paper towels`) — the UI shows it as the step label.\n\nSTATE: the browser session and workspace persist across calls; Python variables do NOT (fresh interpreter each call). The workspace dir is $BH_AGENT_WORKSPACE (also `workspace` in every result); functions defined in agent_helpers.py there are auto-imported into every call. For multi-item tasks ('all N products / every entry'), append each batch to a JSON/CSV file in the workspace, then read it back and aggregate in code — dedupe/count/sort with Python, not in your head — and verify the collected count against what was asked before answering.\n\nBatch each sub-procedure (navigate, wait, extract, act) into one call — do not spend a call per action — but for long extractions prefer several medium calls that append to workspace files over one giant call, so progress survives timeouts. Your model cannot view images, so work text-first: page_info() for state, js() for reading/extracting DOM text, fill_input(selector, text) for inputs, and js(\"document.querySelector('…').click()\") for clicks — skip the screenshot-driven workflow described below.\n\nHELPERS (pre-imported): new_tab(url) opens/navigates (use for the FIRST navigation), goto_url(url) navigates the current tab, wait_for_load() after navigation, page_info() summarizes the current page state, js(expr) evaluates a JS expression and returns its value (js('document.title'); wrap function bodies as js('(() => {...})()') — a bare '() => {...}' returns the function itself, uncalled), fill_input(selector, text) types into inputs, click_at_xy(x, y) clicks viewport coordinates, capture_screenshot() saves and prints a screenshot path, cdp('Domain.method', **kwargs) is raw CDP — cdp('Accessibility.getFullAXTree')['nodes'] lists every element's role/name/backendDOMNodeId (filter in Python before printing; it is thousands of nodes), then cdp('DOM.getBoxModel', backendNodeId=n) gives click coordinates. ensure_real_tab() recovers from a stale/internal tab. Login walls: never guess credentials; see the vault note below if present, otherwise stop and ask the user. 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.",
+ "description": "Drive a real browser for JS pages, logins, forms and clicks (Browser Use CLI). `code` runs as full Python (stdlib available) with pre-imported browser helpers; stdout comes back in the result. Start `code` with a one-line comment describing the step for the user in plain language, max 60 chars (e.g. `# Searching Amazon for paper towels`) — the UI shows it as the step label.\n\nSTATE: the browser session and workspace persist across calls; Python variables do NOT (fresh interpreter each call). The workspace dir is $BH_AGENT_WORKSPACE (also `workspace` in every result); functions defined in agent_helpers.py there are auto-imported into every call. For multi-item tasks ('all N products / every entry'), append each batch to a JSON/CSV file in the workspace, then read it back and aggregate in code — dedupe/count/sort with Python, not in your head — and verify the collected count against what was asked before answering.\n\nBatch each sub-procedure (navigate, wait, extract, act) into one call — do not spend a call per action — but for long extractions prefer several medium calls that append to workspace files over one giant call, so progress survives timeouts. Screenshots are not attached to this tool's results and no vision route is configured, so work text-first: page_info() for state, js() for reading/extracting DOM text, fill_input(selector, text) for inputs, and js(\"document.querySelector('…').click()\") for clicks.\n\nHELPERS (pre-imported): new_tab(url) opens/navigates (use for the FIRST navigation), goto_url(url) navigates the current tab, wait_for_load() after navigation, page_info() summarizes the current page state, js(expr) evaluates a JS expression and returns its value (js('document.title'); wrap function bodies as js('(() => {...})()') — a bare '() => {...}' returns the function itself, uncalled), fill_input(selector, text) types into inputs, click_at_xy(x, y) clicks viewport coordinates, capture_screenshot() saves and prints a screenshot path, cdp('Domain.method', **kwargs) is raw CDP — cdp('Accessibility.getFullAXTree')['nodes'] lists every element's role/name/backendDOMNodeId (filter in Python before printing; it is thousands of nodes), then cdp('DOM.getBoxModel', backendNodeId=n) gives click coordinates. ensure_real_tab() recovers from a stale/internal tab. Login walls: never guess credentials; see the vault note below if present, otherwise stop and ask the user. 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_exec",
"parameters": {
"properties": {
diff --git a/tests/fixtures/prompt_surface/tools/memory.json b/tests/fixtures/prompt_surface/tools/memory.json
index 52a87a3007e..d31f10b6565 100644
--- a/tests/fixtures/prompt_surface/tools/memory.json
+++ b/tests/fixtures/prompt_surface/tools/memory.json
@@ -1,31 +1,10 @@
{
- "description": "Save durable facts to persistent memory that survive across sessions. Memory is injected into every future turn, so keep entries compact and high-signal.\n\nHOW: make ALL your changes to one target in ONE call via an 'operations' array (each item: {action, content?, old_text?}). The batch applies atomically and the char limit is checked only on the FINAL result — so a single call can remove/patch stale entries to free room AND add new ones, even when an add alone would overflow. The response reports current/limit chars and confirms completion; one batch call finishes the update, so don't repeat it. Use the bare action/content/old_text fields only for a single lone change.\n\nWHEN: only for facts that apply to EVERY session regardless of task: who the user is, stable environment facts, standing conventions with no task home. Anything learned while doing a task (procedures, pitfalls, and the user's preferences and corrections for that kind of work) belongs in the task's skill via skill_manage, where it loads only when relevant; memory is injected into every turn and must stay small.\n\nIF FULL: an add is rejected with the current entries shown. Reissue as ONE batch that removes or shortens enough stale entries and adds the new one together.\n\nTARGETS: 'user' = who the user is (name, role, preferences, style). 'memory' = your notes (environment, conventions, tool quirks, lessons).\n\nSKIP: trivial/obvious info, easily re-discovered facts, raw data dumps, task progress, completed-work logs, temporary TODO state (use session_search for those). Reusable procedures belong in a skill, not memory.",
+ "description": "Save durable facts to persistent memory that survive across sessions. Memory is injected into every future turn, so keep entries compact and high-signal.\n\nHOW: make ALL your changes to one target in ONE call via an 'operations' array (each item: {action, content?, old_text?}). The batch applies atomically and the char limit is checked only on the FINAL result — so a single call can remove/patch stale entries to free room AND add new ones, even when an add alone would overflow. The response reports current/limit chars and confirms completion; one batch call finishes the update, so don't repeat it.\n\nWHEN: only for facts that apply to EVERY session regardless of task: who the user is, stable environment facts, standing conventions with no task home. Anything learned while doing a task (procedures, pitfalls, and the user's preferences and corrections for that kind of work) belongs in the task's skill via skill_manage, where it loads only when relevant; memory is injected into every turn and must stay small.\n\nIF FULL: an add is rejected with the current entries shown. Reissue as ONE batch that removes or shortens enough stale entries and adds the new one together.\n\nTARGETS: 'user' = who the user is (name, role, preferences, style). 'memory' = your notes (environment, conventions, tool quirks, lessons).\n\nSKIP: trivial/obvious info, easily re-discovered facts, raw data dumps, task progress, completed-work logs, temporary TODO state (use session_search for those). Reusable procedures belong in a skill, not memory.",
"name": "memory",
"parameters": {
"properties": {
- "action": {
- "description": "The action to perform (single-op shape). Omit when using 'operations'.",
- "enum": [
- "add",
- "patch",
- "remove"
- ],
- "type": "string"
- },
- "content": {
- "description": "Required for 'add' and 'patch'. For 'add', the new entry. For 'patch', the text that replaces old_text; the rest of the entry is kept. Alias: 'new_text'.",
- "type": "string"
- },
- "new_text": {
- "description": "Alias for 'content'. If both are set, 'content' wins.",
- "type": "string"
- },
- "old_text": {
- "description": "REQUIRED for 'patch' and 'remove': text from one entry. 'patch' replaces exactly this span (it must occur once in the entry); 'remove' deletes the whole entry. Omit for 'add'.",
- "type": "string"
- },
"operations": {
- "description": "Batch shape: a list of operations applied atomically in one call against the final char budget. Preferred when making multiple changes or consolidating to make room. Each item is {action, content?, old_text?}.",
+ "description": "Changes applied atomically in one call against the final char budget; a single change is a one-item list.",
"items": {
"additionalProperties": false,
"properties": {
@@ -38,15 +17,11 @@
"type": "string"
},
"content": {
- "description": "Required for add and patch, as 'content' above.",
- "type": "string"
- },
- "new_text": {
- "description": "Alias for 'content' in a batch op.",
+ "description": "Required for 'add' and 'patch'. For 'add', the new entry. For 'patch', the text that replaces old_text; the rest of the entry is kept.",
"type": "string"
},
"old_text": {
- "description": "As 'old_text' above.",
+ "description": "REQUIRED for 'patch' and 'remove': text from one entry. 'patch' replaces exactly this span (it must occur once in the entry); 'remove' deletes the whole entry. Omit for 'add'.",
"type": "string"
}
},
@@ -67,7 +42,8 @@
}
},
"required": [
- "target"
+ "target",
+ "operations"
],
"type": "object"
}
diff --git a/tests/fixtures/prompt_surface/tools/search_files.json b/tests/fixtures/prompt_surface/tools/search_files.json
index 9e5ce92e952..40d35deef45 100644
--- a/tests/fixtures/prompt_surface/tools/search_files.json
+++ b/tests/fixtures/prompt_surface/tools/search_files.json
@@ -1,5 +1,5 @@
{
- "description": "Search file contents or find files by name. Use this instead of grep/rg/find/ls in terminal. Ripgrep-backed, faster than shell equivalents. On macOS, broad searches above the user home automatically skip TCC-protected folders (Desktop, Documents, Downloads, Library, Movies, Music, Pictures); target one directly when access is intentional.\n\nContent search (target='content'): Regex search inside files. Output modes: full matches with line numbers, file paths only, or match counts.\n\nFile search (target='files'): Find files by glob pattern (e.g., '*.py', '*config*'). Also use this instead of ls. Discovery order is the fast bounded default; exact global newest-first order is an explicit opt-in and may scan the full tree.",
+ "description": "Search file contents or find files by name. Use this instead of grep/rg/find/ls in terminal. Ripgrep-backed, faster than shell equivalents.\n\nContent search (target='content'): Regex search inside files. Output modes: full matches with line numbers, file paths only, or match counts.\n\nFile search (target='files'): Find files by glob pattern (e.g., '*.py', '*config*'). Also use this instead of ls. Discovery order is the fast bounded default; exact global newest-first order is an explicit opt-in and may scan the full tree.",
"name": "search_files",
"parameters": {
"properties": {
diff --git a/tests/fixtures/prompt_surface/tools/skill_view.json b/tests/fixtures/prompt_surface/tools/skill_view.json
index 659ef9469a3..678141c768b 100644
--- a/tests/fixtures/prompt_surface/tools/skill_view.json
+++ b/tests/fixtures/prompt_surface/tools/skill_view.json
@@ -8,7 +8,7 @@
"type": "string"
},
"name": {
- "description": "The skill name (use skills_list to see available skills). For plugin-provided skills, use the qualified form '<plugin>:<skill>' (e.g. 'superpowers:writing-plans').",
+ "description": "The skill name (use skills_list to see available skills). For plugin-provided skills, use the qualified form 'plugin:skill'.",
"type": "string"
}
},