Skip to main content

Module session

Module session 

Source
Expand description

Session persistence: recent workspaces, and which one to reopen (ARCHITECTURE.md §13, §16 Phase 02).

Reads and writes through FileSystemService like everything else, so the whole thing is testable against the in-memory fake and the service boundary holds.

Phase 02 persisted only the workspace roots. Phase 10 added the rest of what §23 item 10 asks for — open buffers, the active tab, pane geometry, and terminal working directories — as a best-effort RestoredWorkspace alongside the MRU list.

The agent session is the one piece that does not persist, and that is a protocol limit rather than a gap here: this client has no session/load, so a restored workspace starts a fresh session and keeps the prior transcript as read-only history (ADR-0014 §4, docs/support.md).

The format is a table, and unknown keys written by a newer build survive a round-trip, so adding keys does not break old files in either direction.

Structs§

AgentHistoryLine
One display-only line from the prior agent session. It is never replayed to ACP.
FileSessionStore
Stores the session as TOML at a fixed path, through the filesystem service.
MemorySessionStore
A store that keeps the session in memory. For tests, and for running with no home directory — persistence is a convenience, not a requirement.
PaneGeometry
Persisted pane percentages. Kept in the workspace crate so session persistence does not make the state crate depend on the UI crate.
RestoredWorkspace
Workspace-owned state that can be reconstructed without pretending to resume an OS process or ACP session (ADR-0014 §4).
Session
What survives a restart.
SessionDiagnostic

Enums§

AgentHistorySpeaker
Speaker identity for transcript history persisted independently of ACP wire state.

Traits§

SessionStore
Service boundary: persist and restore workspace sessions. Widgets and the agent go through this trait, never the OS directly (ARCHITECTURE.md §7.4).