jackwener/OpenCLI · error · TimeoutError

yuanbao ask

Error message

yuanbao ask

What it means

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.

Source

Thrown at clis/yuanbao/ask.js:346

            throw authRequired('Yuanbao opened a login gate before sending the prompt.');
        }
        await setYuanbaoInternetSearch(page, useSearch);
        await setYuanbaoDeepThink(page, useThink);
        const beforeAssistantMessages = await getYuanbaoAssistantMessages(page);
        const beforeLines = await getYuanbaoTranscriptLines(page);
        const sendResult = await sendYuanbaoMessage(page, prompt);
        if (!sendResult?.ok) {
            if (await hasLoginGate(page)) {
                throw authRequired('Yuanbao opened a login gate instead of accepting the prompt.');
            }
            throw sendFailure(sendResult?.reason, sendResult?.detail);
        }
        const response = await waitForYuanbaoResponse(page, beforeAssistantMessages.length, beforeLines, prompt, timeout);
        if (response === 'blocked') {
            throw authRequired('Yuanbao opened a login gate instead of returning a chat response.');
        }
        if (!response) {
            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.');
        }
        return [
            { Role: 'User', Text: prompt },
            { Role: 'Assistant', Text: response },
        ];
    },
});
export const __test__ = {
    collectYuanbaoTranscriptAdditions,
    convertYuanbaoHtmlToMarkdown,
    isOnYuanbao,
    normalizeBooleanFlag,
    pickLatestYuanbaoAssistantCandidate,
    sanitizeYuanbaoResponseText,
    updateStableState,
};

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry with a larger --timeout (e.g. --timeout 120).
  2. Verify the browser session is alive — re-open or re-authenticate the session.
  3. Retry once; transient slowness often resolves on a second attempt.
  4. Update the CLI if Yuanbao changed how responses render.

Example fix

// before
$ opencli yuanbao ask --timeout 30 "long analysis question..."
TimeoutError: yuanbao ask timed out after 30s
// after
$ opencli yuanbao ask --timeout 120 "long analysis question..."
Defensive patterns

Strategy: retry

Validate before calling

// Pre-check the session is interactive before sending a long prompt
const alive = await ensureYuanbaoPage(page); // throws authRequired if a login gate appears

Try / catch

let resp;
for (let attempt = 1; attempt <= 2 && !resp; attempt++) {
  try { resp = await run(['yuanbao', 'ask', '--timeout', '120', prompt]); }
  catch (e) {
    if (!/timed out/i.test(e.message) && e.name !== 'TimeoutError') throw e;
    if (attempt === 2) throw e;
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/c31b043e29278056. Report an issue: GitHub.