jackwener/OpenCLI · info · AuthRequiredError
Waiting for Doubao login
Error message
Waiting for Doubao login
What it means
During the interactive Doubao login flow, the CLI polls the page for a logged-in signal (d.data.user_id_str from the account check). As long as that signal is absent, it throws AuthRequiredError with this message so the driver keeps waiting for the user to log in. It is an expected state, not a bug: the browser session is simply not authenticated yet.
Source
Thrown at clis/doubao/auth.js:62
site: 'doubao',
domain: 'www.doubao.com',
loginUrl: 'https://www.doubao.com/chat/',
columns: ['user_id', 'name'],
verify: verifyDoubaoIdentity,
// passport_csrf_token is set for anonymous sessions too, so a cookie gate
// would navigate away mid-login. Probe the account API on the current page
// (no goto) and only confirm once a real user_id is present.
poll: async (page) => {
const loggedIn = await page.evaluate(`(async () => {
try {
const r = await fetch('/passport/account/info/v2/', { credentials: 'include', headers: { Accept: 'application/json' } });
if (!r.ok) return false;
const d = await r.json();
return !!(d?.data?.user_id_str);
} catch { return false; }
})()`);
if (!loggedIn) {
throw new AuthRequiredError('www.doubao.com', 'Waiting for Doubao login');
}
return verifyDoubaoIdentity(page);
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Complete the Doubao login in the opened browser window and wait for the flow to continue
- Keep the Doubao tab open until the CLI reports success
- Check network connectivity if the page never finishes loading
- Re-run the login command if the tab was closed or redirected
Example fix
// before (caller aborting on this error)
try { await login(); } catch (e) { console.error(e); }
// after
try { await login(); } catch (e) {
if (!(e instanceof AuthRequiredError)) throw e; // keep waiting while login pending
} Defensive patterns
Strategy: retry
Validate before calling
const r = await page.evaluate(async () => {
const d = await (await fetch('/passport/account/info/')).json();
return !!(d?.data?.user_id_str);
});
if (!r) console.log('Doubao login not yet complete; keep waiting'); Type guard
function isLoggedInPayload(d) { return typeof d?.data?.user_id_str === 'string' && d.data.user_id_str.length > 0; } Try / catch
try {
await waitForLogin(page);
} catch (e) {
if (e instanceof AuthRequiredError && e.message === 'Waiting for Doubao login') {
await waitForUserLoginWithTimeout(page, 120_000); // poll longer before giving up
} else throw e;
} Prevention
- Keep the login tab open until the flow completes
- Allow generous time for 2FA/captcha during login
- Verify cookies persist between runs (non-incognito profile)
- Warn users clearly that manual login action is required
When it happens
Trigger: waitForLogin's polled page.evaluate returns loggedIn=false because the user has not completed the Doubao login in the browser, the login page was closed early, or the response lacks data.user_id_str.
Common situations: User delays entering credentials/2FA; login page redirects somewhere the poller can't read; cookies cleared mid-flow; slow network leaving the check endpoint unanswered.
Related errors
- Unexpected Doubao probe: ${JSON.stringify(result)}
- Waiting for Jike login: ${detail}
- Waiting for Jimeng login
- Waiting for Ke lianjia_token cookie
- Waiting for Kimi auth cookies
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/50d2f065a8f4f649.
Report an issue: GitHub.