Skip to content

[Bug] Runtime repair passes only transcript tail — full session history is dropped from new context #104

Description

@nleononline

Summary

When MiniMax Code repairs a session (after daemon restart, idle timeout, OOM, or mode switch), the new runtime receives only the last ~4 messages in its <visible-transcript> block. The full conversation history exists on disk but is not loaded into the new context — the model loses awareness of the original task, scope, and prior decisions, and may believe it never received the task at all.

This is not an LLM-summarization failure. The summarization mechanism (session_context_epoch) exists but is never triggered, because the repair path bypasses it entirely.

Environment

  • MiniMax Code (Electron) on macOS
  • Observed session at time of repair: 513 messages, 2.2 MB on disk
  • OpenCode DB: ~/.local/share/opencode/opencode.db
  • Mavis DB: ~/.mavis/sqlite.db

Reproduction

  1. Run an ongoing session with significant context.
  2. Trigger a runtime repair (daemon restart, OpenCode crash, long idle, etc.).
  3. Inspect the <visible-transcript> block delivered to the new session.

Expected

The repaired session reconstructs full context — either by injecting the complete session_messages history, by running session_context_epoch summarization, or by restoring from $MAVIS_SCRATCHPAD.

Actual

Only the last ~4 messages are passed. No summary, no history injection, no scratchpad restore.

Findings

  • ~/.mavis/sqlite.db.session_messages retains the complete history (513 messages / 2.2 MB in the observed case). The data is on disk — it's just not loaded.
  • ~/.local/share/opencode/opencode.db.session_context_epoch exists with a proper schema for LLM summarization (baseline, snapshot, baseline_seq, replacement_seq), but the table is empty — the mechanism never ran in observed sessions.
  • The session was far below the LLM-context limit, so summarization was never triggered organically either.
  • Conclusion: "context loss after repair" is the repair path skipping both summary and history-injection. Not a token-limit issue, not an LLM-summary quality issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions