Skip to content

mecatui: open an existing session by ID (view its transcript) #245

Description

@JAORMX

Summary

mecatui today has no "open an existing session by ID and view its transcript" path. The conversation view is built exclusively from a live Converse stream — it never loads persisted history. client.GetSession returns metadata-only (Mode + ResolvedModel); the proto Session message carries no conversation messages; and the only event-replay RPC (EventLogService) lives in the driver protocol, not the public HarnessService mecatui consumes.

This blocks #235 (Scheduled tasks Phase 3b: jump-to-fire-transcript), which wants to open a past fire's sched-- session rendered as a normal conversation view. #235's premise — "reuse the existing session-open path" — does not match the code as shipped: there is no such path to reuse.

Scope

Add the capability for mecatui to open a past session by ID and render its prior conversation (transcript) as the normal conversation view, then allow continued interaction.

Two layers:

1. Server: a public event-replay RPC on HarnessService

Add a streaming RPC backed by the existing port.EventLog.Read (already a durable seam, ADR 0027 Phase 3a; the relay persists events; nothing model-facing). This is the honest path: the events already exist in the log; mecatui just needs to read them back.

  • New proto RPC on HarnessService (e.g. StreamSessionEvents(session_id) → stream Events) in contracts/proto/mecatl/v1/.
  • Server Service method over the existing EventLog.Read iter.Seq2[session.Event, error].
  • task generate to regenerate contracts/gen.
  • This RPC touches the public proto surface → task api:update + engine/CHANGELOG.md note may apply if it crosses the engine port (likely not, since it's a server-only RPC, not an engine/port type — confirm during implementation).

2. Client + TUI: translate replayed events → conversation view

  • cmd/mecatui/client/ wrapper translating the streamed events → the existing tea.Msg types (reuse the same EventToMsg mapping the live Converse stream uses).
  • A model path that seeds the conversation view from replayed events, then enters idle (read-only transcript view → can be continued interactively on the next prompt; server-side loadAndReopen replays persisted history to the model).
  • The session-id rebind seam: reuse the /worktrees switch template (switchToWorktree) — endRun + resetSession + adopt the target session id — but replace the CreateSession call with an adopt-id + fetch-transcript step.

Decisions to make

  1. Streaming vs batch. A streaming RPC mirrors Converse (consistent) but a simple GetSessionEvents(id) batch RPC may suffice for transcripts that fit in memory. Streaming is likely the right call for parity + unbounded transcripts.
  2. SessionSnapshot lacks State. To block opening a still-running session (or to live-tail it), client.SessionSnapshot + its mapper need a State field (the proto Session.state already exists). One-field client + mapper addition, no proto change.
  3. Still-running sessions. Block opening a running/awaiting session (simplest), or support live-tail (attach to the in-flight run's event channel)? Live-tail is a larger option — likely out of scope for mecatui: open an existing session by ID (view its transcript) #245, defer.
  4. m.caps after adopt. GetSession does not return ServerCapabilities. After resetSession clears m.caps, caps-driven affordances (like /schedule itself) would vanish. Minimal fix: preserve m.caps across the jump (caps are server-wide anyway).

References

Activity

  1. added
    enhancement
    on Jul 7, 2026
  2. added
    tui
    on Aug 13, 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

    enhancementtuiui

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions