{"record":{"id":"c37b16ee4dc49c86","repo":"jackwener/OpenCLI","slug":"doubao-blocked-the-request-with-a-verification-cha","errorCode":null,"errorMessage":"Doubao blocked the request with a verification challenge","messagePattern":"Doubao blocked the request with a verification challenge","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/doubao/utils.js","lineNumber":719,"sourceCode":"    const clicked = await page.evaluate(clickSendButtonScript());\n    if (clicked) {\n        submittedBy = 'button';\n    }\n    else if (page.nativeKeyPress) {\n        try {\n            await page.nativeKeyPress('Enter');\n        }\n        catch {\n            await page.pressKey('Enter');\n        }\n    }\n    else {\n        await page.pressKey('Enter');\n    }\n    await page.wait(0.8);\n    const verification = await page.evaluate(detectDoubaoVerificationScript());\n    if (verification?.detected) {\n        throw new CommandExecutionError('Doubao blocked the request with a verification challenge', verification.reason\n            ? `Detected challenge signal: ${verification.reason}`\n            : 'Please complete the challenge in the browser and try again.');\n    }\n    return submittedBy;\n}\nexport async function waitForDoubaoResponse(page, beforeLines, beforeTurns, promptText, timeoutSeconds) {\n    const beforeTurnSet = new Set(beforeTurns\n        .filter((turn) => turn.Role === 'Assistant')\n        .map((turn) => `${turn.Role}::${turn.Text}`));\n    const sanitizeCandidate = (value) => value\n        .replace(promptText, '')\n        .replace(/内容由豆包 AI 生成/g, '')\n        .replace(/在此处拖放文件/g, '')\n        .replace(/文件数量：.*$/g, '')\n        .replace(/\\{\"namedChunks\".*$/g, '')\n        .replace(/window\\\\._SSR_DATA.*$/g, '')\n        .trim();\n    const getCandidate = async () => {","sourceCodeStart":701,"sourceCodeEnd":737,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/doubao/utils.js#L701-L737","documentation":"After submitting the message, sendDoubaoMessage runs detectDoubaoVerificationScript(); if Doubao presented an anti-bot/verification challenge, this CommandExecutionError is thrown with the detected signal as detail. The send did not complete as expected because Doubao is requiring human verification.","triggerScenarios":"detectDoubaoVerificationScript() returns {detected:true} right after pressing Enter/clicking send — captcha iframe, slider challenge, or risk-control banner appears in the page.","commonSituations":"Account/IP flagged for automation; too many rapid messages; fresh browser profile without cookies; datacenter IP triggering risk control.","solutions":["Complete the verification challenge manually in the browser, then retry","Slow down message rate and add delays between sends","Use a normal browser profile with established Doubao cookies","Switch network/IP if the current one is flagged"],"exampleFix":"// before\nconst verification = await page.evaluate(detectDoubaoVerificationScript());\nif (verification?.detected) throw new CommandExecutionError('Doubao blocked the request with a verification challenge', ...);\n// after\nconst verification = await page.evaluate(detectDoubaoVerificationScript());\nif (verification?.detected) {\n  await pauseForHumanVerification(page); // waits until challenge dismissed\n}\nconst recheck = await page.evaluate(detectDoubaoVerificationScript());\nif (recheck?.detected) throw new CommandExecutionError('Doubao blocked the request with a verification challenge');","handlingStrategy":"try-catch","validationCode":"const v = await page.evaluate(detectDoubaoVerificationScript());\nif (v?.detected) throw new Error('Resolve the Doubao challenge before sending messages');","typeGuard":null,"tryCatchPattern":"try {\n  await sendDoubaoMessage(page, text);\n} catch (e) {\n  if (/verification challenge/.test(e.message)) {\n    await promptUserToSolveChallenge(page); // block until human resolves\n    await sendDoubaoMessage(page, text);\n  } else throw e;\n}","preventionTips":["Throttle message rate to avoid risk control","Use a persistent, cookie-warmed browser profile","Detect challenges proactively before each send","Avoid datacenter IPs that trigger Doubao risk control"],"tags":["doubao","captcha","verification","rate-limit"],"backgroundTag":"verification-challenge-blocked","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}