Repository navigation
kimi-k2.6 stream drops mid-reasoning (3rd occurrence, 160K context, 76% window) #133
Description
Bug Summary
kimi-k2.6 (Moonshot API) stream drops mid-generation again, showing "× interrupted (esc)" even though the user did not press Escape. This is a recurring occurrence of the Moonshot API bug (related to #132).
Screenshot evidence
- Model was in the middle of its reasoning/thought process (
✓ Thoughtvisible) - Status bar showed:
[kimi-k2.6 · cwd /Users/limyuxi/lawbook · 160331/209k tok (76%) · ⚡158961 cached] - The model had not yet emitted its final response — it died during internal reasoning
Evidence from harness.trajectory.jsonl
Latest interruption at the end of the current session:
{"kind":"turn_error","parent":55,"t":9425434,"detail":"Interrupted"}This is turn 55 of the current session, interrupted after ~2.6 hours of session runtime.
The session started with harness version 0.0.187 (newer than the v0.0.14-2-g11f341f-dirty from the previous occurrence in #132).
Preceding turns in the same session show gpt-5.5 successfully completed its workflow (turns with ok: true), then the harness switched to kimi-k2.6 for the user's follow-up message, which was then interrupted.
Pattern confirmation
This is the third confirmed occurrence of the same Moonshot API stream drop:
- First:
msg[5]in.graff/sessions/adding-recently-viewed-documents.session.json— mid-response - Second:
msg[59]in same session — mid-response - Third: this current session, turn 55 — mid-reasoning/thought (most severe, as it aborts before any output)
Context at time of death
- Model: kimi-k2.6
- Context tokens: 160,331 / 209,000 (76%)
- Cached tokens: 158,961
- Session runtime: ~2.6 hours
- Harness version:
0.0.187
The high context load (160K tokens, 76% of context window) may be a contributing factor to the Moonshot API dropping the stream.
Impact
- The model dies during reasoning, producing zero output for the user
- The user has to re-prompt with the same request
- Token cost is wasted — 160K context + reasoning time is burned with no result
- UX trust is severely degraded because the model appears "unreliable"
Suggested fixes (harness side)
- Retry on interruption: If
turn_error: "Interrupted"occurs with a kimi-k2.6 model AND no user stop signal was received, automatically retry the generation withcontinueor a reduced context window - Distinguish API drops from Esc: Add telemetry to confirm whether the interruption was user-initiated or API-initiated. If API-initiated, do not save
[response interrupted by user]into the session - Context-window aware routing: When context exceeds 70% of the model's window (e.g. 150K+ for kimi-k2.6), warn the user or switch to a model with a larger context window
- Recover partial reasoning: If the stream drops mid-reasoning, attempt to recover the partial thought output rather than discarding everything
Suggested fixes (upstream — Moonshot)
- Report again: Moonshot's kimi-k2.6 consistently drops SSE streams after extended generation with high context. This is reproducible.
- Possible workaround: Moonshot may have a server-side timeout on SSE connections. The harness should send periodic keep-alive pings or break long requests into smaller chunks.
Environment
- Harness version:
0.0.187 - Model: kimi-k2.6
- Session runtime: ~2.6 hours
- Context: 160,331 / 209,000 tokens (76%)
- Occurrence: 3rd confirmed instance
Activity
yxlyx commentedon Jul 9, 2026
4th confirmed occurrence (today)
Context at time of death
Evidence from
harness.trace.jsonlLast kimi-k2.6 entry before session switch:
{"t":47603056,"ev":"api","agent":"main","model":"kimi-k2.6","ms":16103,"req_bytes":2687400,"resp_bytes":14993,"context_tokens":129770,"cache_read_tokens":129354,"is_error":false}Immediately after, the trace starts a new session with gpt-5.5 — no
turn_errorwas recorded for this specific drop, suggesting the stream died silently before the harness could write the error event.Pattern
Same as #133: high context load (129K tokens, 61% of window), massive request payload, then a sudden tiny response before the stream disappears. The harness auto-recovers by switching to a different model (gpt-5.5), but the user's context is lost and they have to re-prompt.
Impact
turn_errorwritten, so the interruption looks like a clean session end rather than a crashEnvironment
Merge pull request #146 from justrach/fix/kimi-stream-drop-133