Skip to content

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

Address Solvecha provider review findings

Barack Sokullu8e2b952e555c
diff --git a/docs/captcha-provider-coverage.md b/docs/captcha-provider-coverage.md
index c4e82df36..b27156eb6 100644
--- a/docs/captcha-provider-coverage.md
+++ b/docs/captcha-provider-coverage.md
@@ -2,7 +2,7 @@
Initial catalog audit: **2026-09-29**. Integration contracts rechecked against first-party documentation on **2026-10-01**. Chrome and Firefox share the provider catalog, request validation, transports, and result handling; their browser execution adapters remain platform-specific.
-This integration exposes **eight providers and 203 catalog method variants**. A method variant can be a proxy/proxyless route, an Enterprise option, a recognition model, or a separate response mode. It is not a claim that there are 198 CAPTCHA products.
+This integration exposes **eight providers and 203 catalog method variants**. A method variant can be a proxy/proxyless route, an Enterprise option, a recognition model, or a separate response mode. It is not a claim that there are 203 CAPTCHA products.
“Integrated” means WebBrain can validate the method's input, submit its documented request, poll when needed, and preserve its answer. It does **not** mean every website exposes the required parameters, that a token is accepted, or that authenticated live success rates have been measured. This implementation was checked with provider-contract fixtures and browser tests; no paid live solves were performed.
diff --git a/src/chrome/src/agent/captcha-native-providers.js b/src/chrome/src/agent/captcha-native-providers.js
index 016ce3c78..70fb97400 100644
--- a/src/chrome/src/agent/captcha-native-providers.js
+++ b/src/chrome/src/agent/captcha-native-providers.js
@@ -479,7 +479,7 @@ function validateFallbackIdentifiers(built) {
// All validation happens before any paid create request. A provider is never
// submitted twice, and a failed page application never restarts this loop.
export function prepareNativeCaptchaTasks(providers, entries) {
- if (!Array.isArray(entries) || !entries.length || entries.length > 7) throw new Error('Provide one to seven providerTasks.');
+ if (!Array.isArray(entries) || !entries.length || entries.length > 8) throw new Error('Provide one to eight providerTasks.');
const seen = new Set();
const built = entries.map(entry => {
if (seen.has(entry.provider)) throw new Error('Only one method per provider is allowed per dispatch.');
diff --git a/src/chrome/src/agent/tools.js b/src/chrome/src/agent/tools.js
index 2246e862a..d387c60c5 100644
--- a/src/chrome/src/agent/tools.js
+++ b/src/chrome/src/agent/tools.js
@@ -1449,7 +1449,7 @@ export const AGENT_TOOLS = [
parameters: {
type: 'object',
properties: {
- providerTasks: {"type": "array", "minItems": 1, "maxItems": 8, "description": "One documented native method per enabled provider, all for the SAME challenge and CAPTCHA family. Settings weights determine fallback order. Never include API keys. Use inject:false.", "items": {"type": "object", "properties": {"provider": {"type": "string", "enum": ["capsolver", "2captcha", "capmonster", "solvecaptcha", "anti-captcha", "nopecha", "nonecap"]}, "method": {"type": "string"}, "parameters": {"type": "object", "description": "Exact provider-native fields from get_captcha_capabilities. Include observed page/challenge parameters and matching proxy when required.", "additionalProperties": true}}, "required": ["provider", "method", "parameters"], "additionalProperties": false}},
+ providerTasks: {"type": "array", "minItems": 1, "maxItems": 8, "description": "One documented native method per enabled provider, all for the SAME challenge and CAPTCHA family. Settings weights determine fallback order. Never include API keys. Use inject:false.", "items": {"type": "object", "properties": {"provider": {"type": "string", "enum": ["capsolver", "2captcha", "capmonster", "solvecaptcha", "anti-captcha", "nopecha", "nonecap", "solvecha"]}, "method": {"type": "string"}, "parameters": {"type": "object", "description": "Exact provider-native fields from get_captcha_capabilities. Include observed page/challenge parameters and matching proxy when required.", "additionalProperties": true}}, "required": ["provider", "method", "parameters"], "additionalProperties": false}},
type: {
type: 'string',
enum: ['recaptcha_v2', 'recaptcha_v3', 'recaptcha_v2_enterprise', 'recaptcha_v3_enterprise', 'hcaptcha', 'turnstile', 'image_to_text', 'aws_waf'],
diff --git a/src/chrome/src/ui/settings.html b/src/chrome/src/ui/settings.html
index 2b302d6aa..c1b736688 100644
--- a/src/chrome/src/ui/settings.html
+++ b/src/chrome/src/ui/settings.html
@@ -660,7 +660,7 @@
<p class="captcha-description"><a id="nonecap-docs" target="_blank" rel="noopener noreferrer" data-i18n="st.captcha.docs"></a></p>
<div class="field">
<label for="nonecap-api-key" data-i18n="st.captcha.provider_key" data-i18n-params='{"provider":"NoneCap"}'></label>
- <input type="password" id="nonecap-api-key" pattern="[A-Za-z0-9_\-]{1,256}" maxlength="256" autocomplete="off" spellcheck="false">
+ <input type="password" id="nonecap-api-key" pattern="nc_live_[A-Za-z0-9_\-]{32}" minlength="40" maxlength="40" placeholder="nc_live_…" autocomplete="off" spellcheck="false">
</div>
<div class="btn-row">
<button class="btn-primary" id="btn-save-nonecap" data-i18n="st.captcha.save"></button>
diff --git a/src/firefox/src/agent/captcha-native-providers.js b/src/firefox/src/agent/captcha-native-providers.js
index 016ce3c78..70fb97400 100644
--- a/src/firefox/src/agent/captcha-native-providers.js
+++ b/src/firefox/src/agent/captcha-native-providers.js
@@ -479,7 +479,7 @@ function validateFallbackIdentifiers(built) {
// All validation happens before any paid create request. A provider is never
// submitted twice, and a failed page application never restarts this loop.
export function prepareNativeCaptchaTasks(providers, entries) {
- if (!Array.isArray(entries) || !entries.length || entries.length > 7) throw new Error('Provide one to seven providerTasks.');
+ if (!Array.isArray(entries) || !entries.length || entries.length > 8) throw new Error('Provide one to eight providerTasks.');
const seen = new Set();
const built = entries.map(entry => {
if (seen.has(entry.provider)) throw new Error('Only one method per provider is allowed per dispatch.');
diff --git a/src/firefox/src/agent/tools.js b/src/firefox/src/agent/tools.js
index a30b9943c..e36eb5b5f 100644
--- a/src/firefox/src/agent/tools.js
+++ b/src/firefox/src/agent/tools.js
@@ -1304,7 +1304,7 @@ export const AGENT_TOOLS = [
parameters: {
type: 'object',
properties: {
- providerTasks: {"type": "array", "minItems": 1, "maxItems": 8, "description": "One documented native method per enabled provider, all for the SAME challenge and CAPTCHA family. Settings weights determine fallback order. Never include API keys. Use inject:false.", "items": {"type": "object", "properties": {"provider": {"type": "string", "enum": ["capsolver", "2captcha", "capmonster", "solvecaptcha", "anti-captcha", "nopecha", "nonecap"]}, "method": {"type": "string"}, "parameters": {"type": "object", "description": "Exact provider-native fields from get_captcha_capabilities. Include observed page/challenge parameters and matching proxy when required.", "additionalProperties": true}}, "required": ["provider", "method", "parameters"], "additionalProperties": false}},
+ providerTasks: {"type": "array", "minItems": 1, "maxItems": 8, "description": "One documented native method per enabled provider, all for the SAME challenge and CAPTCHA family. Settings weights determine fallback order. Never include API keys. Use inject:false.", "items": {"type": "object", "properties": {"provider": {"type": "string", "enum": ["capsolver", "2captcha", "capmonster", "solvecaptcha", "anti-captcha", "nopecha", "nonecap", "solvecha"]}, "method": {"type": "string"}, "parameters": {"type": "object", "description": "Exact provider-native fields from get_captcha_capabilities. Include observed page/challenge parameters and matching proxy when required.", "additionalProperties": true}}, "required": ["provider", "method", "parameters"], "additionalProperties": false}},
type: {
type: 'string',
enum: ['recaptcha_v2', 'recaptcha_v3', 'recaptcha_v2_enterprise', 'recaptcha_v3_enterprise', 'hcaptcha', 'turnstile', 'image_to_text', 'aws_waf'],
diff --git a/src/firefox/src/ui/settings.html b/src/firefox/src/ui/settings.html
index 5bd5d7ee9..8598e8e70 100644
--- a/src/firefox/src/ui/settings.html
+++ b/src/firefox/src/ui/settings.html
@@ -640,7 +640,7 @@
<p class="captcha-description"><a id="nonecap-docs" target="_blank" rel="noopener noreferrer" data-i18n="st.captcha.docs"></a></p>
<div class="field">
<label for="nonecap-api-key" data-i18n="st.captcha.provider_key" data-i18n-params='{"provider":"NoneCap"}'></label>
- <input type="password" id="nonecap-api-key" pattern="[A-Za-z0-9_\-]{1,256}" maxlength="256" autocomplete="off" spellcheck="false">
+ <input type="password" id="nonecap-api-key" pattern="nc_live_[A-Za-z0-9_\-]{32}" minlength="40" maxlength="40" placeholder="nc_live_…" autocomplete="off" spellcheck="false">
</div>
<div class="btn-row">
<button class="btn-primary" id="btn-save-nonecap" data-i18n="st.captcha.save"></button>
diff --git a/test/captcha-native-providers.mjs b/test/captcha-native-providers.mjs
index 1bf86de50..93ba2d82b 100644
--- a/test/captcha-native-providers.mjs
+++ b/test/captcha-native-providers.mjs
@@ -123,6 +123,7 @@ for (const browser of ['chrome','firefox']) {
const entry={provider:'capsolver',method:'AntiCloudflareTask',parameters:{websiteURL:url,proxy:'http:p:80'}};
for(const parameters of [{websiteURL:url},{...entry.parameters,callbackUrl:'https://evil.test'},{...entry.parameters,type:'UnknownTask'},JSON.parse('{"__proto__":{"polluted":true}}')]) assert.throws(()=>native.prepareNativeCaptchaTasks(providers,[{...entry,parameters}]));
assert.throws(()=>native.prepareNativeCaptchaTasks(providers,[entry,entry]),/one method/);
+ assert.throws(()=>native.prepareNativeCaptchaTasks(providers,Array.from({length:9},()=>entry)),/one to eight/);
assert.throws(()=>native.prepareNativeCaptchaTasks([], [entry]),/enabled/);
assert.throws(()=>native.prepareNativeCaptchaTasks([{id:'capsolver',useCloudBroker:true}], [entry]),/personal/);
assert.throws(()=>native.prepareNativeCaptchaTasks(providers,[entry,{provider:'nonecap',method:'hcaptcha',parameters:{sitekey:'site',url}}]),/same CAPTCHA/);
@@ -335,6 +336,13 @@ for (const browser of ['chrome','firefox']) {
assert.throws(()=>native.buildNativeCaptchaTask({provider:'solvecha',method:'recognition/textcaptcha',parameters:{image_data:['a','b']}}),/exactly one input/);
assert.throws(()=>native.buildNativeCaptchaTask({provider:'solvecha',method:'recognition/recaptcha',parameters:{task:'cars',grid:'5x5',image_data:['a']}}),/Invalid reCAPTCHA recognition grid/);
});
+ test(`${browser}: solve_captcha schema accepts Solvecha native tasks`,async()=>{
+ const {AGENT_TOOLS}=await import(`../src/${browser}/src/agent/tools.js`);
+ const {validateToolArguments}=await import(`../src/${browser}/src/agent/tool-arguments.js`);
+ const tool=AGENT_TOOLS.find(t=>t.function.name==='solve_captcha');
+ const args={providerTasks:[{provider:'solvecha',method:'recognition/recaptcha',parameters:{task:'cars',grid:'3x3',image_data:['base64']}}],inject:false};
+ assert.equal(validateToolArguments('solve_captcha',args,tool.function.parameters).ok,true);
+ });
test(`${browser}: SolveCaptcha form polling decodes object results, without flattening them into token strings`,async t=>{
const calls=mockApi(t,c=>c.url.pathname==='/in.php'?{status:1,request:'123'}:{status:1,request:'{"captcha_id":"id","lot_number":"lot"}'});
const result=await native.solveNativeCaptchaTasks(native.prepareNativeCaptchaTasks(providers,[{provider:'solvecaptcha',method:'geetest_v4',parameters:{pageurl:url,captcha_id:'id'}}]));