/resume inside the TUI is a session picker for the directory it was opened in, and Enter swaps the live session under the running window (this supersedes Decision 24)¶
TUI decision 65 · accepted · 2026-09-15 · supersedes 24
Decision 24 argued that swapping a session under a live TUI buys little, but the shell round trip is the whole cost of coming back to work: you had to quit, remember or list ids, and retype troupe resume <id> — and /sessions printed a comma-separated list of opaque ids from every workspace, which is the one thing nobody can act on. The picker lists what the state dir holds for this workspace — the row number /resume 2 takes, how long ago each session was written to, its branches and what they came to rest as, and the first branch's prompt as a title — with the session on screen marked and cursor-selected, so the list always says where you are. Sessions are matched by the exact workspace path, because that is what the state dir is keyed by (Paths.sessions_root/1): a session started in a subdirectory of a repo is a different list, not a fuzzy match nobody could predict. Branch-less sessions are hidden (except the one on screen) — the scratch session troupe opens before you have dispatched anything has nothing to resume — and switching away from one stops it, so it does not keep a watcher and a memory refresher alive behind the session you moved to. A session that did work keeps running, so its agents finish and you can switch back; the window is no longer subscribed to it, so handle_info drops events from any session it is not showing rather than folding them into the wrong model (Model.apply/2 would raise on an unknown window). Switching is otherwise the restart path and nothing else: unsubscribe, subscribe, Model.rebuild/3 over the other log, and the TUI's registered name follows the session so TUI.Server.via/1 stays truthful. The session being resumed inherits the live session's provider and config rather than re-reading the files, so a toggle flipped this run (auto-approve, watch, a model) survives the switch — Dispatcher.provider/1 exists for that. Listing is a fold over the log like everything else, but a narrow one (Session.Index): only the four branch events are decoded, so a session with a megabyte of llm_delta costs about as much as an empty one, which is what makes it safe to build in a keypress handler. troupe resume with no id now reopens the newest session that got as far as a branch and lands on the picker, instead of silently choosing for you.
Governs: clients/tui/lib/troupe/ui/tui/server.ex