You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(runtime): safe-boundary continuation silently drops prior-turn history from the provider request #5907
A long session whose provider-reported context usage had exceeded the model's reported window was interrupted mid-turn (stop button) and later resumed through the safe-boundary continuation path. The continuation replayed the interrupted turn's full event prefix correctly, but the rebuilt provider request silently excluded all prior completed-turn history — no compaction checkpoint, no summarization call, no projection transitions, and no user-facing indication. The model continues the turn with amnesia of everything that happened before the interrupted turn.
Expected: the continued turn's provider request contains the full session history (as the pre-abort requests did) — or, if reduction at this seam is intended, it goes through a visible, durable compaction (summary + checkpoint), never a silent drop.
Evidence from ~/.config/Maka/workspaces/default/runtime.sqlite:
304,452 − 81,600 = 222,852 ≈ the runtime's own estimate of the prior-turn history alone: contextBudget.estimatedTokens = 230,549 over keptEvents = 1007, keptTurns = 2 (runtime_fact recorded at abort time). The continued turn's requests never re-include the prior history across 10+ subsequent steps.
Turn extents (runtime_session_turn_extents)
turn
ordinals
events
in post-resume provider context?
5bd23f43 (first ~1.2 h of work)
1–997
997
no
26223850
998–1007
10
no
582a5323 (interrupted)
1008–1335
328
yes — fully replayed (sourceRuntimeEventHighWater: 328 = the source invocation's full extent)
093a6dd1 (continuation)
1336–
ongoing
yes
Every legitimate reduction channel is ruled out: no summarization call (every post-resume attempt is call_kind = main), no history-compact checkpoint events in runtime_events, and no new model_projection_transition records (only 2 exist, both from the first turn, matching its prunedToolResults: 2). The durable ledger is intact — the 1,007 events exist in runtime_events; they simply never enter the continued turn's provider requests.
How to reproduce
Build a session with substantial completed-turn history (observed: ~230k estimated tokens across 2 turns).
Start a new turn and let it run until provider-reported input approaches or exceeds the model's context window (observed: 304k on a 262k-window model).
Abort the turn mid-flight (stop button).
Resume the session so the runtime continues the interrupted turn via safe-boundary continuation (invocation_opened with source.kind = continuation).
Compare input_tokens of the last pre-abort attempt with the first post-resume attempt in usage_model_call_attempts; the drop equals the size of the prior-turn history.
Observed once in the wild on a real session; not yet reduced to a scripted minimal reproduction.
Environment
Maka version or commit: 1e80e3b885 (runtime-host running from source checkout)
OS and version: Linux x64
Surface: TUI + Runtime Host
Node.js version: 26.3.0
Connection/model: kimi-coding-plan / k3-256k (fetched contextWindow 262,144); modelOverrides empty, so no compactionThreshold is declared and proactive history compaction is not armed — which rules out compaction as the cause of the drop.
User-visible symptom: the TUI ctx segment follows the latest settled request's inputTokens, so it falls from 262k/262k 100% to ~82k/262k 31% right after resume — looking exactly like a successful "compression" that never happened.
What happened
A long session whose provider-reported context usage had exceeded the model's reported window was interrupted mid-turn (stop button) and later resumed through the safe-boundary continuation path. The continuation replayed the interrupted turn's full event prefix correctly, but the rebuilt provider request silently excluded all prior completed-turn history — no compaction checkpoint, no summarization call, no projection transitions, and no user-facing indication. The model continues the turn with amnesia of everything that happened before the interrupted turn.
Expected: the continued turn's provider request contains the full session history (as the pre-abort requests did) — or, if reduction at this seam is intended, it goes through a visible, durable compaction (summary + checkpoint), never a silent drop.
Evidence from
~/.config/Maka/workspaces/default/runtime.sqlite:Provider request sizes (
usage_model_call_attempts)304,452 − 81,600 = 222,852≈ the runtime's own estimate of the prior-turn history alone:contextBudget.estimatedTokens = 230,549overkeptEvents = 1007,keptTurns = 2(runtime_fact recorded at abort time). The continued turn's requests never re-include the prior history across 10+ subsequent steps.Turn extents (
runtime_session_turn_extents)sourceRuntimeEventHighWater: 328= the source invocation's full extent)Every legitimate reduction channel is ruled out: no summarization call (every post-resume attempt is
call_kind = main), no history-compact checkpoint events inruntime_events, and no newmodel_projection_transitionrecords (only 2 exist, both from the first turn, matching itsprunedToolResults: 2). The durable ledger is intact — the 1,007 events exist inruntime_events; they simply never enter the continued turn's provider requests.How to reproduce
invocation_openedwithsource.kind = continuation).input_tokensof the last pre-abort attempt with the first post-resume attempt inusage_model_call_attempts; the drop equals the size of the prior-turn history.Observed once in the wild on a real session; not yet reduced to a scripted minimal reproduction.
Environment
1e80e3b885(runtime-host running from source checkout)kimi-coding-plan/k3-256k(fetchedcontextWindow262,144);modelOverridesempty, so nocompactionThresholdis declared and proactive history compaction is not armed — which rules out compaction as the cause of the drop.Logs, screenshots, or additional context
inputTokens, so it falls from262k/262k 100%to~82k/262k 31%right after resume — looking exactly like a successful "compression" that never happened.cb1d809b-4cf5-473e-811f-4802c2c19d46, source turn582a5323-0e80-4876-a3be-45276ead74d4, continuation turn093a6dd1-0720-441e-8774-bb014590baef, continuation invocationedf3ca60-610c-4bb1-bbd2-a50dab41fe87.Drafted with AI-agent assistance (Maka) from local runtime forensics; reviewed and submitted by @me2seeks.