{"record":{"id":"c31b043e29278056","repo":"jackwener/OpenCLI","slug":"yuanbao-ask","errorCode":null,"errorMessage":"yuanbao ask","messagePattern":"yuanbao ask","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"clis/yuanbao/ask.js","lineNumber":346,"sourceCode":"            throw authRequired('Yuanbao opened a login gate before sending the prompt.');\n        }\n        await setYuanbaoInternetSearch(page, useSearch);\n        await setYuanbaoDeepThink(page, useThink);\n        const beforeAssistantMessages = await getYuanbaoAssistantMessages(page);\n        const beforeLines = await getYuanbaoTranscriptLines(page);\n        const sendResult = await sendYuanbaoMessage(page, prompt);\n        if (!sendResult?.ok) {\n            if (await hasLoginGate(page)) {\n                throw authRequired('Yuanbao opened a login gate instead of accepting the prompt.');\n            }\n            throw sendFailure(sendResult?.reason, sendResult?.detail);\n        }\n        const response = await waitForYuanbaoResponse(page, beforeAssistantMessages.length, beforeLines, prompt, timeout);\n        if (response === 'blocked') {\n            throw authRequired('Yuanbao opened a login gate instead of returning a chat response.');\n        }\n        if (!response) {\n            throw new TimeoutError('yuanbao ask', timeout, 'No Yuanbao response was observed before the timeout. Retry with --timeout, and verify the current browser session is still interactive.');\n        }\n        return [\n            { Role: 'User', Text: prompt },\n            { Role: 'Assistant', Text: response },\n        ];\n    },\n});\nexport const __test__ = {\n    collectYuanbaoTranscriptAdditions,\n    convertYuanbaoHtmlToMarkdown,\n    isOnYuanbao,\n    normalizeBooleanFlag,\n    pickLatestYuanbaoAssistantCandidate,\n    sanitizeYuanbaoResponseText,\n    updateStableState,\n};\n","sourceCodeStart":328,"sourceCodeEnd":363,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/yuanbao/ask.js#L328-L363","documentation":"A TimeoutError from `yuanbao ask` raised when waitForYuanbaoResponse returned nothing (no new assistant message) within the --timeout window. The error carries the command name and timeout and advises raising the timeout and checking that the browser session is still interactive. It means the prompt was sent but no response was observed in time — a slow model, a stalled page, or a response that the watcher failed to detect.","triggerScenarios":"Calling `yuanbao ask` with a low --timeout while the model responds slowly; the page stalled after sending the prompt; the assistant reply rendered in a DOM shape the response watcher does not recognize; a network hiccup preventing the response from arriving.","commonSituations":"Long, reasoning-heavy prompts exceeding the default timeout; peak-time Yuanbao slowness; a stale browser session whose page stopped updating; CLI version lagging behind a Yuanbao UI change.","solutions":["Retry with a larger --timeout (e.g. --timeout 120).","Verify the browser session is alive — re-open or re-authenticate the session.","Retry once; transient slowness often resolves on a second attempt.","Update the CLI if Yuanbao changed how responses render."],"exampleFix":"// before\n$ opencli yuanbao ask --timeout 30 \"long analysis question...\"\nTimeoutError: yuanbao ask timed out after 30s\n// after\n$ opencli yuanbao ask --timeout 120 \"long analysis question...\"","handlingStrategy":"retry","validationCode":"// Pre-check the session is interactive before sending a long prompt\nconst alive = await ensureYuanbaoPage(page); // throws authRequired if a login gate appears","typeGuard":null,"tryCatchPattern":"let resp;\nfor (let attempt = 1; attempt <= 2 && !resp; attempt++) {\n  try { resp = await run(['yuanbao', 'ask', '--timeout', '120', prompt]); }\n  catch (e) {\n    if (!/timed out/i.test(e.message) && e.name !== 'TimeoutError') throw e;\n    if (attempt === 2) throw e;\n  }\n}","preventionTips":["Use a generous --timeout (90-180s) for long or reasoning-heavy prompts","Verify the session is authenticated and interactive before sending","Retry once on timeout before surfacing — Yuanbao can be transiently slow","Keep the CLI updated so response-watching matches current Yuanbao rendering"],"tags":["timeout","yuanbao","network","cli"],"backgroundTag":"response-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}