{"record":{"id":"327aa9595111a657","repo":"jackwener/OpenCLI","slug":"no-yuanbao-conversations-found-in-the-sidebar-eit","errorCode":null,"errorMessage":"No Yuanbao conversations found in the sidebar. Either the account is logged out, the sidebar is collapsed, or the user truly has no chat history yet.","messagePattern":"No Yuanbao conversations found in the sidebar\\. Either the account is logged out, the sidebar is collapsed, or the user truly has no chat history yet\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/yuanbao/history.js","lineNumber":38,"sourceCode":"    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [\n        { name: 'limit', type: 'int', default: 20, help: 'Max conversations to list (sidebar virtual scroll caps actual count)' },\n    ],\n    columns: ['Index', 'Title', 'AgentId', 'SessionId', 'Url'],\n    func: async (page, kwargs) => {\n        const limit = Number(kwargs.limit ?? 20);\n        if (!Number.isInteger(limit) || limit <= 0) {\n            throw new ArgumentError('limit', 'must be a positive integer');\n        }\n        await ensureYuanbaoPage(page);\n        if (await hasLoginGate(page)) {\n            throw authRequired('Yuanbao opened a login gate when reading the sidebar.');\n        }\n        await page.wait(1.5);\n        const sessions = await getYuanbaoSessionList(page, limit);\n        if (!sessions.length) {\n            throw new EmptyResultError(\n                'yuanbao history',\n                'No Yuanbao conversations found in the sidebar. Either the account is logged out, the sidebar is collapsed, or the user truly has no chat history yet.',\n            );\n        }\n        return sessions.map((s, i) => ({\n            Index: i + 1,\n            Title: s.title || '(untitled)',\n            AgentId: s.agentId,\n            SessionId: s.cid,\n            Url: `${YUANBAO_URL}chat/${s.agentId}/${s.cid}`,\n        }));\n    },\n});\n","sourceCodeStart":20,"sourceCodeEnd":52,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/yuanbao/history.js#L20-L52","documentation":"The history command scraped the conversation sidebar and found zero rendered items. The library throws EmptyResultError distinguishing 'nothing to show' from a hard failure, listing the three plausible causes: logged-out session, collapsed sidebar, or genuinely empty account.","triggerScenarios":"`yuanbao history` executes, the login gate check passes, getYuanbaoSessionList returns an empty array after 1.5s wait — sidebar DOM (.yb-recent-conv-list__item) has no visible items.","commonSituations":"Expired Yuanbao session cookies that do not trip the explicit login gate; a fresh account with no chats; narrow browser viewport collapsing the sidebar; slow page load where the 1.5s static wait outpaces the sidebar render.","solutions":["Open Yuanbao in a browser, verify you are logged in and the sidebar shows conversations, then rerun","Re-run with a longer warm-up or reopen the page (ensureYuanbaoPage) to let the sidebar finish rendering","Confirm the account actually has chat history; if brand new, this error is expected","Check whether the sidebar is collapsed in the automation browser profile and expand it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// cannot pre-validate; but you can check login state first\nif (!(await isLoggedIn(page))) await runLoginFlow(page);","typeGuard":"const hasSessions = (r) => Array.isArray(r) && r.length > 0;","tryCatchPattern":"try {\n  const sessions = await cli.yuanbaoHistory({ limit: 20 });\n} catch (e) {\n  if (e.name === 'EmptyResultError') {\n    console.warn('No Yuanbao conversations; account may be empty or logged out');\n    return [];\n  }\n  throw e;\n}","preventionTips":["Ensure the browser profile is logged into Yuanbao before running","Expand the sidebar / use a viewport size that keeps it rendered","Add warm-up waits for slow loads; treat empty result as retryable once","Distinguish 'new account, no history' from 'logged out' in automation logs"],"tags":["empty-result","dom-scraping","auth"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}