Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Vision mode: give CAPTCHAs the automatic solve route only

Emre Sokullub3a7b0296177
diff --git a/docs/vision-mode.md b/docs/vision-mode.md
index 88309494c..cda4193f8 100644
--- a/docs/vision-mode.md
+++ b/docs/vision-mode.md
@@ -27,9 +27,9 @@ A vision run gets its tier's Act tools with the DOM-targeting ones replaced (`VI
| Removed | Added |
|---|---|
-| `get_accessibility_tree`, `click_ax`, `type_ax`, `set_field`, `set_checked`, `hover`, `drag_drop`, `inspect_viewport`, `get_interactive_elements`, `click`, `scroll`, `browser_batch`, `wait_for_element`, `find_text`, `verify_form`, `iframe_*`, `get_frames`, `get_shadow_dom`, `shadow_dom_query`, `promote_iframe`, `carousel_navigate`, `upload_file`, `download_resource_from_page` | `click_at`, `scroll_at`, `hover_at`, `drag_at`, `zoom`, `take_screenshot`, `wait` |
+| `get_accessibility_tree`, `click_ax`, `type_ax`, `set_field`, `set_checked`, `hover`, `drag_drop`, `inspect_viewport`, `get_interactive_elements`, `click`, `scroll`, `browser_batch`, `wait_for_element`, `find_text`, `verify_form`, `iframe_*`, `get_frames`, `get_shadow_dom`, `shadow_dom_query`, `promote_iframe`, `carousel_navigate`, `upload_file`, `download_resource_from_page`, `get_captcha_capabilities`, `apply_captcha_solution` | `click_at`, `scroll_at`, `hover_at`, `drag_at`, `zoom`, `take_screenshot`, `wait` |
-`type_text` stays with a vision schema (`text`, `clear`; it types into the focused field). Everything that does not name a DOM target is kept: `press_keys`, `navigate`, `go_back`/`go_forward`, `read_page`, `read_pdf`, `extract_data`, `fetch_url`, downloads, scheduling, `scratchpad_write`, `progress_*`, `clarify`, `done`, skills and the CAPTCHA tools. `read_page` is the cheap way to get exact long text; screenshots are the primary view.
+`type_text` stays with a vision schema (`text`, `clear`; it types into the focused field). Everything that does not name a DOM target is kept: `press_keys`, `navigate`, `go_back`/`go_forward`, `read_page`, `read_pdf`, `extract_data`, `fetch_url`, downloads, scheduling, `scratchpad_write`, `progress_*`, `clarify`, `done`, skills and `solve_captcha`. A CAPTCHA's native provider methods are applied to frame and field bindings only the tree names, so a vision run gets `solve_captcha`'s automatic route only: its schema has no `providerTasks` (`visionSolveCaptchaTool`), the native-method tools are removed, and the `[CAPTCHA SOLVER]` note tells it to call `solve_captcha` once and let WebBrain check clearance (`visionCaptchaSolverNote`), not to read the tree. `read_page` is the cheap way to get exact long text; screenshots are the primary view.
| Tool | What it does |
|---|---|
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.js
index 2886de037..3f1f668ea 100644
--- a/src/chrome/src/agent/agent.js
+++ b/src/chrome/src/agent/agent.js
@@ -22,7 +22,7 @@ import { SOCIAL_PLATFORMS, socialPublicationApiPlatform, normalizePublicationCon
import { mastodonPublicationIntentMessages, normalizeMastodonPublicationIntent, captureNativeMastodonPublication, mastodonPublicationBinding, mastodonPublicationReceipt, mastodonPublicationNavigation } from './mastodon-publication.js';
import { AGENT_TOOLS, AGENT_TOOL_NAMES, RESERVED_AGENT_TOOL_NAMES, RETIRED_AGENT_TOOL_NAMES, getToolsForMode, SYSTEM_PROMPT_BATCHING, SYSTEM_PROMPT_ASK, SYSTEM_PROMPT_ACT, SYSTEM_PROMPT_ACT_COMPACT, SYSTEM_PROMPT_ACT_MID, SYSTEM_PROMPT_LEAN_NOTE, SYSTEM_PROMPT_GENERATIVE_MEDIA, SYSTEM_PROMPT_DEV_APPENDIX, SYSTEM_PROMPT_WEBMCP_ASK, SYSTEM_PROMPT_WEBMCP_ACT, getVisionActPrompt } from './tools.js';
import { installVisionRuntime } from './vision-runtime.js';
-import { VISION_NATIVE_TOOLS, VISION_SITE_NOTES_PREFACE, visionFilePickerBlockedResult, visionUniversalPreamble } from './vision-tools.js';
+import { VISION_NATIVE_TOOLS, VISION_SITE_NOTES_PREFACE, visionCaptchaSolverNote, visionFilePickerBlockedResult, visionUniversalPreamble } from './vision-tools.js';
import { visionDomProbeExpression } from './vision-dom-probe.js';
import { normalizeVisionModeSetting } from './vision-mode.js';
import { rejectedCompletionRecovery } from './completion-recovery.js';
@@ -37099,7 +37099,12 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
// SYSTEM_PROMPT_ACT stands. The note unlocks the solve_captcha tool
// path described there.
if (this.captchaSolverEnabled && this._captchaToolsAvailable(tabId, mode, tier)) {
- prompt += `\n\n[CAPTCHA SOLVER β€” the user has enabled a CAPTCHA solver. Enabled providers run in descending weight order; failure or timeout tries the next compatible provider. Each attempt may charge. This fallback is internal to one tool call, not permission to call the tool again. Enabled coverage: ${this.captchaProviderIds.some(id => captchaProviderSupportsType(id, 'recaptcha_v2')) ? 'reCAPTCHA v2/v3 including Enterprise, Turnstile, and image CAPTCHAs. ' : ''}${this.captchaProviderIds.some(id => captchaProviderSupportsType(id, 'hcaptcha')) ? 'hCaptcha via NopeCHA or NoneCap. ' : 'hCaptcha requires manual completion. '} For other CAPTCHA families, call get_captcha_capabilities, inspect the chosen method schemas, and supply providerTasks to solve_captcha with inject:false. All documented token, recognition, cookie, and structured-answer methods are available through that route. Supply observed inputs for each compatible enabled provider so weight-based fallback can run. Apply the answer with apply_captcha_solution. When a CAPTCHA or verification dialog blocks a step, read the page/tree without dismissing it. The runtime will route a supported widget to \`solve_captcha\` once and block page-changing actions until a fresh root accessibility-tree read confirms the dialog cleared. If neither automatic nor native inputs can be obtained, the solve fails, or the dialog remains after solving, stop and ask the user to complete it manually; never dismiss and resubmit or retry solve_captcha. These limits apply per challenge: a new CAPTCHA that appears later, such as after a submit or on a newly loaded page, is a separate challenge. Read the page and solve it once with solve_captcha before asking the user.]`;
+ const coverage = `${this.captchaProviderIds.some(id => captchaProviderSupportsType(id, 'recaptcha_v2')) ? 'reCAPTCHA v2/v3 including Enterprise, Turnstile, and image CAPTCHAs. ' : ''}${this.captchaProviderIds.some(id => captchaProviderSupportsType(id, 'hcaptcha')) ? 'hCaptcha via NopeCHA or NoneCap. ' : 'hCaptcha requires manual completion. '}`;
+ // A vision run has no tree to read and no native-method tools: its note
+ // names the automatic route only (vision-tools.js).
+ prompt += this._visionRunState(tabId, mode).active === true
+ ? `\n\n${visionCaptchaSolverNote(coverage)}`
+ : `\n\n[CAPTCHA SOLVER β€” the user has enabled a CAPTCHA solver. Enabled providers run in descending weight order; failure or timeout tries the next compatible provider. Each attempt may charge. This fallback is internal to one tool call, not permission to call the tool again. Enabled coverage: ${coverage} For other CAPTCHA families, call get_captcha_capabilities, inspect the chosen method schemas, and supply providerTasks to solve_captcha with inject:false. All documented token, recognition, cookie, and structured-answer methods are available through that route. Supply observed inputs for each compatible enabled provider so weight-based fallback can run. Apply the answer with apply_captcha_solution. When a CAPTCHA or verification dialog blocks a step, read the page/tree without dismissing it. The runtime will route a supported widget to \`solve_captcha\` once and block page-changing actions until a fresh root accessibility-tree read confirms the dialog cleared. If neither automatic nor native inputs can be obtained, the solve fails, or the dialog remains after solving, stop and ask the user to complete it manually; never dismiss and resubmit or retry solve_captcha. These limits apply per challenge: a new CAPTCHA that appears later, such as after a submit or on a newly loaded page, is a separate challenge. Read the page and solve it once with solve_captcha before asking the user.]`;
}
// Ordinary turns get the one-line rendering; the full block is reserved for
diff --git a/src/chrome/src/agent/vision-tools.js b/src/chrome/src/agent/vision-tools.js
index 0929228a2..d0baf20f4 100644
--- a/src/chrome/src/agent/vision-tools.js
+++ b/src/chrome/src/agent/vision-tools.js
@@ -30,6 +30,9 @@ export const VISION_REMOVED_TOOLS = Object.freeze(new Set([
'iframe_read', 'iframe_click', 'iframe_type', 'get_frames', 'get_shadow_dom',
'shadow_dom_query', 'promote_iframe', 'carousel_navigate', 'upload_file',
'download_resource_from_page',
+ // A CAPTCHA's native methods are applied to frame and field bindings only
+ // the tree names; solve_captcha's automatic route needs neither.
+ 'get_captcha_capabilities', 'apply_captcha_solution',
]));
// Tools after which WebBrain does not need to look at the screen again.
@@ -193,6 +196,21 @@ export function visionTypeTextTool(baseTool) {
};
}
+const VISION_SOLVE_CAPTCHA_DESCRIPTION = 'Solve the CAPTCHA blocking this page with the providers enabled in Settings β†’ CAPTCHA, in descending weight order; one call may charge several providers on fallback. Call it once, normally with no arguments: WebBrain finds the widget in the page itself (reCAPTCHA v2/v3, hCaptcha with NopeCHA or NoneCap, Turnstile, AWS WAF, image CAPTCHAs) and checks that the challenge cleared before the next page-changing action; look at the next screen. If the result lists ambiguous candidates, call it again with the exact frameUrl, frameId or framePath it names. Never call it again for the same unresolved challenge: if it fails or the challenge stays, ask the user to complete it.';
+
+/** solve_captcha for a vision run: the automatic route, without native provider tasks. */
+export function visionSolveCaptchaTool(baseTool) {
+ const { providerTasks, ...properties } = baseTool?.function?.parameters?.properties || {};
+ return {
+ ...baseTool,
+ function: {
+ ...baseTool.function,
+ description: VISION_SOLVE_CAPTCHA_DESCRIPTION,
+ parameters: { ...baseTool.function.parameters, properties },
+ },
+ };
+}
+
/**
* Turn a tier's Act tool list into the vision tool list: DOM-targeting
* tools out, coordinate tools in (after `type_text`, so the list reads in
@@ -203,7 +221,7 @@ export function buildVisionToolSet(baseTools, { coordinates = 'pixel' } = {}) {
for (const tool of Array.isArray(baseTools) ? baseTools : []) {
const name = tool?.function?.name;
if (!name || VISION_REMOVED_TOOLS.has(name) || VISION_TOOL_NAMES.has(name)) continue;
- kept.push(name === 'type_text' ? visionTypeTextTool(tool) : tool);
+ kept.push(name === 'type_text' ? visionTypeTextTool(tool) : name === 'solve_captcha' ? visionSolveCaptchaTool(tool) : tool);
}
const vision = visionToolDefinitions({ coordinates });
const anchor = kept.findIndex(tool => tool.function.name === 'navigate');
@@ -340,6 +358,11 @@ export function visionUniversalPreamble(preamble) {
* come with this line, so the model keeps their facts about the site and
* does not reach for tools it does not have.
*/
+/** The [CAPTCHA SOLVER] system-prompt note for a vision run (agent _buildSystemPrompt). */
+export function visionCaptchaSolverNote(coverage) {
+ return `[CAPTCHA SOLVER β€” the user has enabled a CAPTCHA solver. Enabled providers run in descending weight order; failure or timeout tries the next compatible provider. Each attempt may charge. This fallback is internal to one tool call, not permission to call the tool again. Enabled coverage: ${coverage} When a CAPTCHA or verification dialog blocks a step, do not dismiss it: call solve_captcha once, normally with no arguments. WebBrain reads the page itself to find the widget, and checks that the dialog cleared before any page-changing action; look at the next screen. If the family is not covered, the solve fails, or the dialog remains, stop and ask the user to complete it manually; never dismiss and resubmit or retry solve_captcha. These limits apply per challenge: a new CAPTCHA that appears later, such as after a submit or on a newly loaded page, is a separate challenge. Solve it once with solve_captcha before asking the user.]`;
+}
+
export const VISION_SITE_NOTES_PREFACE = '(Written for WebBrain\'s element tools: click_ax, set_field, type_ax, ref ids, selectors and the accessibility tree are not available in this run. Apply the facts about the site with click_at, type_text, press_keys and scroll_at on what the screenshots show.)';
/**
diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.js
index cedc35361..3e66c6f4b 100644
--- a/src/firefox/src/agent/agent.js
+++ b/src/firefox/src/agent/agent.js
@@ -21,7 +21,7 @@ import { SOCIAL_PLATFORMS, socialPublicationApiPlatform, normalizePublicationCon
import { mastodonPublicationIntentMessages, normalizeMastodonPublicationIntent, captureNativeMastodonPublication, mastodonPublicationBinding, mastodonPublicationReceipt, mastodonPublicationNavigation } from './mastodon-publication.js';
import { AGENT_TOOLS, AGENT_TOOL_NAMES, RESERVED_AGENT_TOOL_NAMES, RETIRED_AGENT_TOOL_NAMES, getToolsForMode, SYSTEM_PROMPT_BATCHING, SYSTEM_PROMPT_ASK, SYSTEM_PROMPT_ACT, SYSTEM_PROMPT_ACT_COMPACT, SYSTEM_PROMPT_ACT_MID, SYSTEM_PROMPT_LEAN_NOTE, SYSTEM_PROMPT_GENERATIVE_MEDIA, SYSTEM_PROMPT_DEV_APPENDIX, getVisionActPrompt } from './tools.js';
import { installVisionRuntime } from './vision-runtime.js';
-import { VISION_NATIVE_TOOLS, VISION_SITE_NOTES_PREFACE, visionFilePickerBlockedResult, visionUniversalPreamble } from './vision-tools.js';
+import { VISION_NATIVE_TOOLS, VISION_SITE_NOTES_PREFACE, visionCaptchaSolverNote, visionFilePickerBlockedResult, visionUniversalPreamble } from './vision-tools.js';
import { visionDomProbeExpression } from './vision-dom-probe.js';
import { normalizeVisionModeSetting } from './vision-mode.js';
import { rejectedCompletionRecovery } from './completion-recovery.js';
@@ -33550,7 +33550,12 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
if (memoryPrompt) prompt += `\n\n${memoryPrompt}`;
}
if (this.captchaSolverEnabled && this._captchaToolsAvailable(tabId, mode, tier)) {
- prompt += `\n\n[CAPTCHA SOLVER β€” the user has enabled a CAPTCHA solver. Enabled providers run in descending weight order; failure or timeout tries the next compatible provider. Each attempt may charge. This fallback is internal to one tool call, not permission to call the tool again. Enabled coverage: ${this.captchaProviderIds.some(id => captchaProviderSupportsType(id, 'recaptcha_v2')) ? 'reCAPTCHA v2/v3 including Enterprise, Turnstile, and image CAPTCHAs. ' : ''}${this.captchaProviderIds.some(id => captchaProviderSupportsType(id, 'hcaptcha')) ? 'hCaptcha via NopeCHA or NoneCap. ' : 'hCaptcha requires manual completion. '} For other CAPTCHA families, call get_captcha_capabilities, inspect the chosen method schemas, and supply providerTasks to solve_captcha with inject:false. All documented token, recognition, cookie, and structured-answer methods are available through that route. Supply observed inputs for each compatible enabled provider so weight-based fallback can run. Apply the answer with apply_captcha_solution. When a CAPTCHA or verification dialog blocks a step, read the page/tree without dismissing it. The runtime will route a supported widget to \`solve_captcha\` once and block page-changing actions until a fresh root accessibility-tree read confirms the dialog cleared. If neither automatic nor native inputs can be obtained, the solve fails, or the dialog remains after solving, stop and ask the user to complete it manually; never dismiss and resubmit or retry solve_captcha. These limits apply per challenge: a new CAPTCHA that appears later, such as after a submit or on a newly loaded page, is a separate challenge. Read the page and solve it once with solve_captcha before asking the user.]`;
+ const coverage = `${this.captchaProviderIds.some(id => captchaProviderSupportsType(id, 'recaptcha_v2')) ? 'reCAPTCHA v2/v3 including Enterprise, Turnstile, and image CAPTCHAs. ' : ''}${this.captchaProviderIds.some(id => captchaProviderSupportsType(id, 'hcaptcha')) ? 'hCaptcha via NopeCHA or NoneCap. ' : 'hCaptcha requires manual completion. '}`;
+ // A vision run has no tree to read and no native-method tools: its note
+ // names the automatic route only (vision-tools.js).
+ prompt += this._visionRunState(tabId, mode).active === true
+ ? `\n\n${visionCaptchaSolverNote(coverage)}`
+ : `\n\n[CAPTCHA SOLVER β€” the user has enabled a CAPTCHA solver. Enabled providers run in descending weight order; failure or timeout tries the next compatible provider. Each attempt may charge. This fallback is internal to one tool call, not permission to call the tool again. Enabled coverage: ${coverage} For other CAPTCHA families, call get_captcha_capabilities, inspect the chosen method schemas, and supply providerTasks to solve_captcha with inject:false. All documented token, recognition, cookie, and structured-answer methods are available through that route. Supply observed inputs for each compatible enabled provider so weight-based fallback can run. Apply the answer with apply_captcha_solution. When a CAPTCHA or verification dialog blocks a step, read the page/tree without dismissing it. The runtime will route a supported widget to \`solve_captcha\` once and block page-changing actions until a fresh root accessibility-tree read confirms the dialog cleared. If neither automatic nor native inputs can be obtained, the solve fails, or the dialog remains after solving, stop and ask the user to complete it manually; never dismiss and resubmit or retry solve_captcha. These limits apply per challenge: a new CAPTCHA that appears later, such as after a submit or on a newly loaded page, is a separate challenge. Read the page and solve it once with solve_captcha before asking the user.]`;
}
// Ordinary turns get the one-line rendering; the full block is reserved for
// policies that need the precise wording (translation targets, multilingual
diff --git a/src/firefox/src/agent/vision-tools.js b/src/firefox/src/agent/vision-tools.js
index 0929228a2..d0baf20f4 100644
--- a/src/firefox/src/agent/vision-tools.js
+++ b/src/firefox/src/agent/vision-tools.js
@@ -30,6 +30,9 @@ export const VISION_REMOVED_TOOLS = Object.freeze(new Set([
'iframe_read', 'iframe_click', 'iframe_type', 'get_frames', 'get_shadow_dom',
'shadow_dom_query', 'promote_iframe', 'carousel_navigate', 'upload_file',
'download_resource_from_page',
+ // A CAPTCHA's native methods are applied to frame and field bindings only
+ // the tree names; solve_captcha's automatic route needs neither.
+ 'get_captcha_capabilities', 'apply_captcha_solution',
]));
// Tools after which WebBrain does not need to look at the screen again.
@@ -193,6 +196,21 @@ export function visionTypeTextTool(baseTool) {
};
}
+const VISION_SOLVE_CAPTCHA_DESCRIPTION = 'Solve the CAPTCHA blocking this page with the providers enabled in Settings β†’ CAPTCHA, in descending weight order; one call may charge several providers on fallback. Call it once, normally with no arguments: WebBrain finds the widget in the page itself (reCAPTCHA v2/v3, hCaptcha with NopeCHA or NoneCap, Turnstile, AWS WAF, image CAPTCHAs) and checks that the challenge cleared before the next page-changing action; look at the next screen. If the result lists ambiguous candidates, call it again with the exact frameUrl, frameId or framePath it names. Never call it again for the same unresolved challenge: if it fails or the challenge stays, ask the user to complete it.';
+
+/** solve_captcha for a vision run: the automatic route, without native provider tasks. */
+export function visionSolveCaptchaTool(baseTool) {
+ const { providerTasks, ...properties } = baseTool?.function?.parameters?.properties || {};
+ return {
+ ...baseTool,
+ function: {
+ ...baseTool.function,
+ description: VISION_SOLVE_CAPTCHA_DESCRIPTION,
+ parameters: { ...baseTool.function.parameters, properties },
+ },
+ };
+}
+
/**
* Turn a tier's Act tool list into the vision tool list: DOM-targeting
* tools out, coordinate tools in (after `type_text`, so the list reads in
@@ -203,7 +221,7 @@ export function buildVisionToolSet(baseTools, { coordinates = 'pixel' } = {}) {
for (const tool of Array.isArray(baseTools) ? baseTools : []) {
const name = tool?.function?.name;
if (!name || VISION_REMOVED_TOOLS.has(name) || VISION_TOOL_NAMES.has(name)) continue;
- kept.push(name === 'type_text' ? visionTypeTextTool(tool) : tool);
+ kept.push(name === 'type_text' ? visionTypeTextTool(tool) : name === 'solve_captcha' ? visionSolveCaptchaTool(tool) : tool);
}
const vision = visionToolDefinitions({ coordinates });
const anchor = kept.findIndex(tool => tool.function.name === 'navigate');
@@ -340,6 +358,11 @@ export function visionUniversalPreamble(preamble) {
* come with this line, so the model keeps their facts about the site and
* does not reach for tools it does not have.
*/
+/** The [CAPTCHA SOLVER] system-prompt note for a vision run (agent _buildSystemPrompt). */
+export function visionCaptchaSolverNote(coverage) {
+ return `[CAPTCHA SOLVER β€” the user has enabled a CAPTCHA solver. Enabled providers run in descending weight order; failure or timeout tries the next compatible provider. Each attempt may charge. This fallback is internal to one tool call, not permission to call the tool again. Enabled coverage: ${coverage} When a CAPTCHA or verification dialog blocks a step, do not dismiss it: call solve_captcha once, normally with no arguments. WebBrain reads the page itself to find the widget, and checks that the dialog cleared before any page-changing action; look at the next screen. If the family is not covered, the solve fails, or the dialog remains, stop and ask the user to complete it manually; never dismiss and resubmit or retry solve_captcha. These limits apply per challenge: a new CAPTCHA that appears later, such as after a submit or on a newly loaded page, is a separate challenge. Solve it once with solve_captcha before asking the user.]`;
+}
+
export const VISION_SITE_NOTES_PREFACE = '(Written for WebBrain\'s element tools: click_ax, set_field, type_ax, ref ids, selectors and the accessibility tree are not available in this run. Apply the facts about the site with click_at, type_text, press_keys and scroll_at on what the screenshots show.)';
/**
diff --git a/test/vision-mode-guards.mjs b/test/vision-mode-guards.mjs
index 9d636e347..fa582229b 100644
--- a/test/vision-mode-guards.mjs
+++ b/test/vision-mode-guards.mjs
@@ -606,6 +606,26 @@ for (const build of ['chrome', 'firefox']) {
assert.equal(calls, 2);
});
+ test(`${build}: a vision run gets the automatic CAPTCHA route only, in its tools and its note`, () => {
+ const names = getToolsForMode('act', { tier: 'full', vision: { coordinates: 'pixel' } });
+ const solve = names.find(tool => tool.function.name === 'solve_captcha');
+ assert.ok(solve, 'solve_captcha stays');
+ assert.equal('providerTasks' in solve.function.parameters.properties, false);
+ assert.doesNotMatch(solve.function.description, /get_captcha_capabilities|apply_captcha_solution/);
+ for (const removed of ['get_captcha_capabilities', 'apply_captcha_solution']) assert.ok(!names.some(tool => tool.function.name === removed), removed);
+ const agent = new Agent({ getActive: () => ({ ...seeing, promptTier: 'full' }) });
+ agent.conversationModes.set(1, 'act');
+ agent.captchaSolverEnabled = true;
+ agent.captchaProviderIds = ['nonecap'];
+ agent.visionMode = 'auto';
+ const visionPrompt = agent._buildSystemPrompt('act', 1);
+ assert.match(visionPrompt, /\[CAPTCHA SOLVER β€” /);
+ assert.match(visionPrompt, /call solve_captcha once, normally with no arguments/);
+ assert.doesNotMatch(visionPrompt.slice(visionPrompt.indexOf('[CAPTCHA SOLVER')), /get_captcha_capabilities|apply_captcha_solution|accessibility-tree/);
+ agent.visionMode = 'off';
+ assert.match(agent._buildSystemPrompt('act', 1), /call get_captcha_capabilities/);
+ });
+
test(`${build}: Gmail's result counter, which takes no target, stays in the vision tool list`, () => {
// Offered on a Gmail result list (getGmailResultCountPolicy).
const names = getToolsForMode('act', { tier: 'full', gmailResultCounting: true, vision: { coordinates: 'pixel' } }).map(tool => tool.function.name);