jackwener/OpenCLI · error · AuthRequiredError
AUTH_REQUIRED
AUTH_REQUIRED
Error message
Yuanbao opened a login gate instead of starting a new chat.
What it means
The `yuanbao new` command calls startNewYuanbaoChat(page), which returned 'blocked' because Yuanbao presented a login gate instead of the homepage/new-chat flow. The library surfaces this as AUTH_REQUIRED since a new chat cannot be started while unauthenticated.
Source
Thrown at clis/yuanbao/new.js:65
await page.wait(1);
return 'navigate';
}
export const newCommand = cli({
site: 'yuanbao',
name: 'new',
access: 'read',
description: 'Start a new conversation in Yuanbao web chat',
domain: YUANBAO_DOMAIN,
strategy: Strategy.COOKIE,
browser: true,
siteSession: 'persistent',
navigateBefore: false,
args: [],
columns: ['Status', 'Action'],
func: async (page) => {
const action = await startNewYuanbaoChat(page);
if (action === 'blocked') {
throw authRequired('Yuanbao opened a login gate instead of starting a new chat.');
}
return [{
Status: 'Success',
Action: action === 'navigate' ? 'Reloaded Yuanbao homepage as fallback' : 'Clicked New chat',
}];
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Log in to Yuanbao in the automation browser profile, then rerun `yuanbao new`.
- Use a persisted user-data-dir profile that retains authenticated cookies.
- Check whether the account was logged out remotely and re-authenticate.
- If the gate persists on a logged-in profile, clear stale Yuanbao cookies for the domain and log in again.
Example fix
// before
await cli.run(['yuanbao', 'new']);
// after: guard with an auth pre-check
if (await hasLoginGate(page)) {
await promptInteractiveLogin(page);
}
await cli.run(['yuanbao', 'new']); Defensive patterns
Strategy: try-catch
Validate before calling
// pre-check before invoking 'new' if (await hasLoginGate(page)) await loginToYuanbao(page);
Try / catch
try {
await cli.run(['yuanbao', 'new']);
} catch (e) {
if (e.code === 'AUTH_REQUIRED') { await loginToYuanbao(page); await cli.run(['yuanbao', 'new']); }
else throw e;
} Prevention
- Log in once interactively and persist the profile.
- Monitor session age and re-authenticate before expiry.
- Catch AUTH_REQUIRED at a central wrapper for automatic re-login.
- Check for password changes/remote logouts that invalidate sessions.
When it happens
Trigger: Running `yuanbao new` when startNewYuanbaoChat detects a login gate — the click/fallback navigation to the Yuanbao homepage lands on the login wall and the function returns action === 'blocked'.
Common situations: Expired session on a long-lived automation browser, fresh profile never logged in, or Yuanbao invalidating sessions server-side (e.g., after a security logout or password change).
Related errors
- AUTH_REQUIRED
- AUTH_REQUIRED
- amazon.com
- Claude composer is not available on the current page.
- Facebook c_user cookie missing — anonymous session
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/da78168e148e70c2.
Report an issue: GitHub.