jackwener/OpenCLI · error · TimeoutError

No new Kimi assistant reply was visible before the timeout.

Error message

No new Kimi assistant reply was visible before the timeout.

What it means

TimeoutError thrown by kimi chat ask when, within the configured timeout (default 120s), no new Assistant turn text was captured on the conversation page. The command records the baseline assistant-turn count, sends the message, polls turn text and the generating indicator, and if latestText is still empty at the deadline it throws this error.

Source

Thrown at clis/kimi/chat.js:474

        let stable = 0;
        while (Date.now() < deadline) {
            await page.wait(1.5);
            const turns = await readKimiTurns(page).catch(() => []);
            const assistantTurns = turns.filter((t) => t.role === 'Assistant');
            if (assistantTurns.length <= baselineAssistant) continue;
            const next = assistantTurns[assistantTurns.length - 1]?.text || '';
            if (next && next === latestText) {
                stable++;
            } else {
                latestText = next;
                stable = 0;
            }
            const generating = await isKimiGenerating(page);
            if (latestText && stable >= 2 && !generating) break;
        }
        const elapsed = Math.round((Date.now() - startedAt) / 1000);
        if (!latestText) {
            throw new TimeoutError('kimi ask', timeoutSec, 'No new Kimi assistant reply was visible before the timeout.');
        }
        return [{
            Status: 'reply-received',
            Length: String(text.length),
            WaitedSeconds: String(elapsed),
            ReplyPreview: latestText.slice(0, 300),
        }];
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Increase the --timeout value (e.g. kimi chat ask "..." --timeout 300) for long generations
  2. Verify the message actually appeared in the conversation UI and that Kimi isn't showing an error/rate-limit banner
  3. Check network connectivity and Kimi service status; retry after the outage
  4. If the reply is visible but never detected, inspect readKimiTurns selectors against the current Kimi DOM and update them

Example fix

// before
await kimi(['chat', 'ask', question]); // default 120s timeout
// after
await kimi(['chat', 'ask', question, '--timeout', '300']); // allow long generations
Defensive patterns

Strategy: retry

Validate before calling

// pick a timeout proportional to prompt size / expected reply length
const timeout = Math.max(120, Math.ceil(prompt.length / 10));

Type guard

const isTimeoutError = (e) => e?.name === 'TimeoutError' || /No new Kimi assistant reply/.test(e?.message || '');

Try / catch

try {
  return await kimi(['chat', 'ask', prompt, '--timeout', '300']);
} catch (e) {
  if (isTimeoutError(e)) {
    // check conversation manually, back off, retry once
    await sleep(5000);
    return await kimi(['chat', 'ask', prompt, '--timeout', '300']);
  }
  throw e;
}

Prevention

When it happens

Trigger: sendKimiMessage submitted the prompt but Kimi never rendered an assistant reply before the deadline: the message failed to send, Kimi is rate-limiting or erroring, the reply is rendered in a structure readKimiTurns doesn't recognize, or timeout was set too low for a long generation.

Common situations: Network outage or Kimi outage at send time, hitting usage/rate limits so no reply is produced, very long responses exceeding a small --timeout, or a Kimi DOM change breaking turn extraction so replies are never 'seen'.

Understand the failure class

Related errors


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