Repository navigation
Closed
Labels
tuimecatui terminal UI (rendering, keybindings, footer, panes, scrollback)
Description
Summary
mecatui should persist the session conversation + durable event log by default for the local experience. Today it hardcodes the in-memory memstore, so nothing about a session survives the process — there is no black box to inspect after something goes wrong, and the cloud-native Phase 1 rehydration path has nothing to restore from.
Current state
cmd/mecatui/main.go:353deliberately runs the in-memory store: "the embedded server store is the in-memory memstore (no StoreDir), so nothing persists across restarts."cmd/mecatui/config.goexposes no session--store-dirflag (only--memory-dir, which is the memory store — a different thing). So a durable session store can't even be opted into from the TUI.- What does persist today: the memory store (
~/.local/share/mecatui/memory), the user-model store, and the model selection (~/.local/state/mecatui/models.yaml). The session/event store does not.
Why
- Debuggability (primary).
jsonlstorealready triples asSessionStore+ToolCallRecorder+EventLog(a.events.jsonlsidecar). With it on, every turn'sEvResult{stop,usage},EvNoProgress, andEvCompactionare on disk — turning "it got stuck, why?" into agrep. This is the prerequisite for debugging the empty/truncated-turn bug (filed separately). - Posture. The project's stated default posture is "enable every free + local feature by default; only external/config/trust-gated stays off." A durable session store is free and local, so defaulting it ON is consistent.
- Unlocks resume. Cloud-native Phase 1
rehydrateSessionalready restores a persisted session at the run-entry seam — a durable store makes "resume my last session" possible (see scope note).
Proposed shape (minimal)
- Default
cfg.StoreDirto$XDG_STATE_HOME/mecatui/sessions(mirrorresolveMemoryDir), dir mode0700. - Add a
--store-diroverride and a--no-store/--ephemeralopt-out (consistent with--no-memory). - Engine side needs no change:
internal/app/build.go:1482already flips memstore→jsonl on a non-emptyStoreDir.
Decide as part of this (don't ship a footgun)
- Retention/GC for main sessions.
childGCprunes child snapshots but "main sessions are never touched." A default durable store accumulates main sessions + cumulative.events.jsonlforever — needs an age/count retention policy. - Privacy. The
EventLogstores already-redacted events, but theSessionStorepersists the raw conversation (tool args, file contents) in plaintext JSONL. Acceptable for a single-user local box (parity with~/.claude), but warrants a one-line disclosure in--help/docs. - Concurrency. Confirm
jsonlstoreis safe for two concurrentmecatuiprocesses sharing the dir.
Scope
This issue = the durable store + black box only. An actual resume affordance (session picker UI) is a separate, larger follow-up; the store is its prerequisite.
Filed from a live debugging session (mecatui + deepseek/deepseek-v4-flash over OpenRouter).
Metadata
Metadata
Assignees
Labels
tuimecatui terminal UI (rendering, keybindings, footer, panes, scrollback)
Activity