Register sessions with no live tmux as Dormant on recovery #162

Closed
opened 2026-09-03 23:05:15 +01:00 by naps62-yolo · 0 comments
Collaborator

SessionManager::recover (crates/maestro-daemon/src/session.rs:624) iterates tmux list-sessions and reads each surviving session's sidecar. A host reboot kills the tmux server, so the loop runs over an empty list: every session vanishes from the API while its sidecar sits untouched in <state_dir>/sessions/. The operator is left with no record of what was running.

Add a second pass. After adopting live tmux sessions, read the remaining sidecars and register each as a session with a new SessionStatus::Dormant — id, name, cwd, command, worktree, created_at all intact, no PTY bridge and no tmux session behind it. Clients list them as known-but-not-running.

SessionStatus is a wire type, so this is a protocol change; deserialize unknown variants leniently the way ActivityState already does, so an older client does not choke on a dormant session.

`SessionManager::recover` (`crates/maestro-daemon/src/session.rs:624`) iterates `tmux list-sessions` and reads each surviving session's sidecar. A host reboot kills the tmux server, so the loop runs over an empty list: every session vanishes from the API while its sidecar sits untouched in `<state_dir>/sessions/`. The operator is left with no record of what was running. Add a second pass. After adopting live tmux sessions, read the remaining sidecars and register each as a session with a new `SessionStatus::Dormant` — id, name, cwd, command, worktree, `created_at` all intact, no PTY bridge and no tmux session behind it. Clients list them as known-but-not-running. `SessionStatus` is a wire type, so this is a protocol change; deserialize unknown variants leniently the way `ActivityState` already does, so an older client does not choke on a dormant session.
naps62-yolo added this to the Reboot resilience milestone 2026-09-03 23:05:15 +01:00
naps62-yolo added the area/protocolarea/daemondifficulty/mediumtype/feat labels 2026-09-03 23:05:15 +01:00
naps62-yolo added a new dependency 2026-09-03 23:06:11 +01:00
naps62-yolo added a new dependency 2026-09-03 23:06:12 +01:00
naps62-yolo added a new dependency 2026-09-03 23:06:13 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Reference: naps62/maestro#162