Skip to content

kimi-k2.6 stream drops mid-reasoning (3rd occurrence, 160K context, 76% window) #133

Closed

Description

@yxlyx

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 (✓ Thought visible)
  • 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:

  1. First: msg[5] in .graff/sessions/adding-recently-viewed-documents.session.json — mid-response
  2. Second: msg[59] in same session — mid-response
  3. 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)

  1. 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 with continue or a reduced context window
  2. 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
  3. 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
  4. Recover partial reasoning: If the stream drops mid-reasoning, attempt to recover the partial thought output rather than discarding everything

Suggested fixes (upstream — Moonshot)

  1. Report again: Moonshot's kimi-k2.6 consistently drops SSE streams after extended generation with high context. This is reproducible.
  2. 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

  1. yxlyx commented on Jul 9, 2026

    @yxlyx
    CollaboratorAuthor

    4th confirmed occurrence (today)

    Context at time of death

    • Model: kimi-k2.6
    • Context tokens: 113,603 / 209,000 (54%) per status bar — grew to 129,770 in final trace entry before death
    • Cached tokens: 112,902 → 129,354 (99.7% cached at end)
    • Request payload grew to 2.6 MB (req_bytes: 2,687,400)
    • Final API response was only 14,993 bytes (abnormally small vs previous 47–71 KB responses)
    • Harness switched to gpt-5.5 after the drop

    Evidence from harness.trace.jsonl

    Last 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_error was 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

    • Model dies during reasoning, producing zero output
    • 129K context + 16s of reasoning time wasted
    • User has to re-send the same request in a new session
    • No turn_error written, so the interruption looks like a clean session end rather than a crash

    Environment

    • Harness version: 0.0.187
    • Model: kimi-k2.6
    • Session runtime: ~13 hours (t=47,603,056 ms)
    • Context: 129,770 / 209,000 tokens (62%)
    • Occurrence: 4th confirmed instance
  2. added a commit that references this issue on Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions