{"record":{"id":"86375bc1d84ae6db","repo":"jackwener/OpenCLI","slug":"waiting-for-yuanbao-hy-user-cookie","errorCode":null,"errorMessage":"Waiting for Yuanbao hy_user cookie","messagePattern":"Waiting for Yuanbao hy_user cookie","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"info","filePath":"clis/yuanbao/auth.js","lineNumber":55,"sourceCode":"        }\n        for (const v of Object.values(node)) if (v && typeof v === 'object') stack.push(v);\n      }\n      return { nickname: stateNick || (nickMatch ? nickMatch[0] : '') };\n    })()\n  `);\n  return { user_id: String(hyUser), nickname: String(probe.nickname || '') };\n}\n\nregisterSiteAuthCommands({\n  site: 'yuanbao',\n  domain: YUANBAO_DOMAIN,\n  loginUrl: YUANBAO_URL,\n  columns: ['user_id', 'nickname'],\n  quickCheck: hasYuanbaoUserCookie,\n  verify: verifyYuanbaoIdentity,\n  poll: async (page) => {\n    if (!await hasYuanbaoUserCookie(page)) {\n      throw new AuthRequiredError(YUANBAO_DOMAIN, 'Waiting for Yuanbao hy_user cookie');\n    }\n    return verifyYuanbaoIdentity(page);\n  },\n});\n","sourceCodeStart":37,"sourceCodeEnd":60,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/yuanbao/auth.js#L37-L60","documentation":"An AuthRequiredError thrown by the login poll loop while waiting for the user to complete WeChat login: hasYuanbaoUserCookie still reports no hy_user cookie, so polling continues to signal 'not logged in yet'. It's an expected, transient condition during `yuanbao login` — the error tells the poller the QR code hasn't been scanned/approved yet, and the poll retries until the cookie appears or the deadline expires.","triggerScenarios":"During `yuanbao login`, each poll tick that runs before the user scans the WeChat QR code and the server sets the hy_user cookie. Every poll iteration until login completes throws this.","commonSituations":"User simply hasn't scanned the QR yet (normal); QR expired and needs a refresh; user scanned with the wrong WeChat account; corporate proxy blocking the login handshake.","solutions":["Scan the WeChat QR code with the correct account to complete login — this error is expected until then.","If it persists past the deadline, restart `yuanbao login` to get a fresh QR code.","Check network/proxy access to yuanbao.tencent.com if the scan isn't registering."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Expected during login; just ensure a poll deadline exists\nconst deadline = Date.now() + 120_000;\nwhile (Date.now() < deadline) { /* poll login status */ }","typeGuard":null,"tryCatchPattern":"try {\n  await run(['yuanbao', 'login']);\n} catch (e) {\n  if (/Waiting for Yuanbao hy_user cookie/.test(e.message)) {\n    // still waiting on QR scan — prompt the user, then restart login for a fresh QR\n  } else throw e;\n}","preventionTips":["Complete the QR scan promptly — the code expires","Restart the login command for a fresh QR if polling exceeds the deadline","Scan with the WeChat account you intend to use for the session","Ensure network access to yuanbao.tencent.com isn't blocked by a proxy"],"tags":["yuanbao","authentication","login-flow","polling"],"backgroundTag":"auth-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}