Skip to content

Restore display-only reasoning summaries when reloading sessions #2079

Open

Description

@jbeda

Problem

When a model returns a human-readable reasoning/thinking summary, mecatui displays it in the live assistant card but loses it on session reload. The authoritative transcript is projected from the saved session conversation, which contains assistant text and tool calls but not display-only reasoning.delta summaries. The provider-private Message.Reasoning field is an opaque replay blob, not a display summary and must never be rendered or repurposed.

This applies to the embedded JSONL store and mecak8s's Redis store. The event log may record summaries, but ordinary resume uses the snapshot-derived transcript. A resumed chat should restore summaries that were visible before exit without claiming that they were sent to the model.

Options to evaluate

  1. Enrich from the existing event log. Load the authoritative transcript, then attach recorded reasoning deltas to the appropriate turns. This requires no new snapshot data, but the log is optional and best-effort: failed appends and gaps make an exact restored view impossible. Define matching through compaction, forks, and repeated runs and clearly distinguish missing history from a model that returned no summary.
  2. Preferred direction: persist a separate, bounded display-summary record with the session snapshot. Keep display summaries distinct from the model-visible conversation and opaque provider replay state, then project them through an authorized human-facing transcript/read surface. This can support a reliable reload in both JSONL and Redis deployments even without complete event replay. Define when it is saved (including interrupted turns and approvals), size limits, retention, compaction, fork/carryover, legacy snapshots, and failure behavior. Do not assume an extra uncoordinated write gives snapshot-equivalent durability.
  3. Server-composed display-history view. The server combines authoritative snapshot data with available activity evidence and reports source/completeness explicitly; this keeps reconciliation out of mecatui. A view backed only by the event log inherits option 1's gaps; pair with option 2 if exact restoration is promised.

Option 2 is a direction to design and review, not an approved schema or acceptance contract. Evaluate whether the requirement is exact restoration of visible summaries or best-effort historical enrichment, then use the appropriate acceptance-plan route for persistence/API decisions.

Verification questions

  • Can a live summary be restored after process restart with no event log, with a failed/missing log append, and with another client or mecak8s replica reading the session?
  • How does summary-to-turn identity survive compaction, fork/carryover, and transcript rehydration without mixing summary text into model input or exposing opaque replay blobs?
  • What is shown for a legitimately absent provider summary versus missing/corrupt display data? Are storage growth, access control, and terminal sanitization bounded?

Related to #1361 (conversation UX), but not part of slimming tool-call cards or inspector result rendering (#2066). Existing boundaries: engine/session/conversation.go, internal/adapter/server/transcript.go, ADR 0217, and cmd/mecatui/ui/sessions_surface.go.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions