{"record":{"id":"da78168e148e70c2","repo":"jackwener/OpenCLI","slug":"auth-required-da7816","errorCode":"AUTH_REQUIRED","errorMessage":"Yuanbao opened a login gate instead of starting a new chat.","messagePattern":"Yuanbao opened a login gate instead of starting a new chat\\.","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/yuanbao/new.js","lineNumber":65,"sourceCode":"    await page.wait(1);\n    return 'navigate';\n}\nexport const newCommand = cli({\n    site: 'yuanbao',\n    name: 'new',\n    access: 'read',\n    description: 'Start a new conversation in Yuanbao web chat',\n    domain: YUANBAO_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [],\n    columns: ['Status', 'Action'],\n    func: async (page) => {\n        const action = await startNewYuanbaoChat(page);\n        if (action === 'blocked') {\n            throw authRequired('Yuanbao opened a login gate instead of starting a new chat.');\n        }\n        return [{\n                Status: 'Success',\n                Action: action === 'navigate' ? 'Reloaded Yuanbao homepage as fallback' : 'Clicked New chat',\n            }];\n    },\n});\n","sourceCodeStart":47,"sourceCodeEnd":73,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/yuanbao/new.js#L47-L73","documentation":"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.","triggerScenarios":"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'.","commonSituations":"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).","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."],"exampleFix":"// before\nawait cli.run(['yuanbao', 'new']);\n// after: guard with an auth pre-check\nif (await hasLoginGate(page)) {\n  await promptInteractiveLogin(page);\n}\nawait cli.run(['yuanbao', 'new']);","handlingStrategy":"try-catch","validationCode":"// pre-check before invoking 'new'\nif (await hasLoginGate(page)) await loginToYuanbao(page);","typeGuard":null,"tryCatchPattern":"try {\n  await cli.run(['yuanbao', 'new']);\n} catch (e) {\n  if (e.code === 'AUTH_REQUIRED') { await loginToYuanbao(page); await cli.run(['yuanbao', 'new']); }\n  else throw e;\n}","preventionTips":["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."],"tags":["authentication","browser-automation","yuanbao"],"backgroundTag":"browser-login-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}