{"record":{"id":"5c1d120a5c976582","repo":"jackwener/OpenCLI","slug":"no-new-kimi-assistant-reply-was-visible-before-the","errorCode":null,"errorMessage":"No new Kimi assistant reply was visible before the timeout.","messagePattern":"No new Kimi assistant reply was visible before the timeout\\.","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"clis/kimi/chat.js","lineNumber":474,"sourceCode":"        let stable = 0;\n        while (Date.now() < deadline) {\n            await page.wait(1.5);\n            const turns = await readKimiTurns(page).catch(() => []);\n            const assistantTurns = turns.filter((t) => t.role === 'Assistant');\n            if (assistantTurns.length <= baselineAssistant) continue;\n            const next = assistantTurns[assistantTurns.length - 1]?.text || '';\n            if (next && next === latestText) {\n                stable++;\n            } else {\n                latestText = next;\n                stable = 0;\n            }\n            const generating = await isKimiGenerating(page);\n            if (latestText && stable >= 2 && !generating) break;\n        }\n        const elapsed = Math.round((Date.now() - startedAt) / 1000);\n        if (!latestText) {\n            throw new TimeoutError('kimi ask', timeoutSec, 'No new Kimi assistant reply was visible before the timeout.');\n        }\n        return [{\n            Status: 'reply-received',\n            Length: String(text.length),\n            WaitedSeconds: String(elapsed),\n            ReplyPreview: latestText.slice(0, 300),\n        }];\n    },\n});\n","sourceCodeStart":456,"sourceCodeEnd":484,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/kimi/chat.js#L456-L484","documentation":"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.","triggerScenarios":"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.","commonSituations":"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'.","solutions":["Increase the --timeout value (e.g. kimi chat ask \"...\" --timeout 300) for long generations","Verify the message actually appeared in the conversation UI and that Kimi isn't showing an error/rate-limit banner","Check network connectivity and Kimi service status; retry after the outage","If the reply is visible but never detected, inspect readKimiTurns selectors against the current Kimi DOM and update them"],"exampleFix":"// before\nawait kimi(['chat', 'ask', question]); // default 120s timeout\n// after\nawait kimi(['chat', 'ask', question, '--timeout', '300']); // allow long generations","handlingStrategy":"retry","validationCode":"// pick a timeout proportional to prompt size / expected reply length\nconst timeout = Math.max(120, Math.ceil(prompt.length / 10));","typeGuard":"const isTimeoutError = (e) => e?.name === 'TimeoutError' || /No new Kimi assistant reply/.test(e?.message || '');","tryCatchPattern":"try {\n  return await kimi(['chat', 'ask', prompt, '--timeout', '300']);\n} catch (e) {\n  if (isTimeoutError(e)) {\n    // check conversation manually, back off, retry once\n    await sleep(5000);\n    return await kimi(['chat', 'ask', prompt, '--timeout', '300']);\n  }\n  throw e;\n}","preventionTips":["Use generous --timeout values for long generations","Monitor Kimi status/rate limits before batching asks","Retry with backoff on timeout","If replies are visible but never detected, update readKimiTurns selectors after DOM changes"],"tags":["timeout","browser-automation","kimi"],"backgroundTag":"reply-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}