jackwener/OpenCLI · error · CommandExecutionError

Doubao blocked the request with a verification challenge

Error message

Doubao blocked the request with a verification challenge

What it means

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.

Source

Thrown at clis/doubao/utils.js:719

    const clicked = await page.evaluate(clickSendButtonScript());
    if (clicked) {
        submittedBy = 'button';
    }
    else if (page.nativeKeyPress) {
        try {
            await page.nativeKeyPress('Enter');
        }
        catch {
            await page.pressKey('Enter');
        }
    }
    else {
        await page.pressKey('Enter');
    }
    await page.wait(0.8);
    const verification = await page.evaluate(detectDoubaoVerificationScript());
    if (verification?.detected) {
        throw new CommandExecutionError('Doubao blocked the request with a verification challenge', verification.reason
            ? `Detected challenge signal: ${verification.reason}`
            : 'Please complete the challenge in the browser and try again.');
    }
    return submittedBy;
}
export async function waitForDoubaoResponse(page, beforeLines, beforeTurns, promptText, timeoutSeconds) {
    const beforeTurnSet = new Set(beforeTurns
        .filter((turn) => turn.Role === 'Assistant')
        .map((turn) => `${turn.Role}::${turn.Text}`));
    const sanitizeCandidate = (value) => value
        .replace(promptText, '')
        .replace(/内容由豆包 AI 生成/g, '')
        .replace(/在此处拖放文件/g, '')
        .replace(/文件数量:.*$/g, '')
        .replace(/\{"namedChunks".*$/g, '')
        .replace(/window\\._SSR_DATA.*$/g, '')
        .trim();
    const getCandidate = async () => {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Complete the verification challenge manually in the browser, then retry
  2. Slow down message rate and add delays between sends
  3. Use a normal browser profile with established Doubao cookies
  4. Switch network/IP if the current one is flagged

Example fix

// before
const verification = await page.evaluate(detectDoubaoVerificationScript());
if (verification?.detected) throw new CommandExecutionError('Doubao blocked the request with a verification challenge', ...);
// after
const verification = await page.evaluate(detectDoubaoVerificationScript());
if (verification?.detected) {
  await pauseForHumanVerification(page); // waits until challenge dismissed
}
const recheck = await page.evaluate(detectDoubaoVerificationScript());
if (recheck?.detected) throw new CommandExecutionError('Doubao blocked the request with a verification challenge');
Defensive patterns

Strategy: try-catch

Validate before calling

const v = await page.evaluate(detectDoubaoVerificationScript());
if (v?.detected) throw new Error('Resolve the Doubao challenge before sending messages');

Try / catch

try {
  await sendDoubaoMessage(page, text);
} catch (e) {
  if (/verification challenge/.test(e.message)) {
    await promptUserToSolveChallenge(page); // block until human resolves
    await sendDoubaoMessage(page, text);
  } else throw e;
}

Prevention

When it happens

Trigger: detectDoubaoVerificationScript() returns {detected:true} right after pressing Enter/clicking send — captcha iframe, slider challenge, or risk-control banner appears in the page.

Common situations: Account/IP flagged for automation; too many rapid messages; fresh browser profile without cookies; datacenter IP triggering risk control.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/c37b16ee4dc49c86. Report an issue: GitHub.