Prune sidecars whose working directory no longer exists #163

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

Sidecars are written on create and deleted on kill, and nothing else ever removes one. A session whose worktree was deleted by hand, or that died in a way that skipped the kill path, leaves a JSON file behind forever. A real host had five such orphans pointing at worktrees that no longer exist.

During the recovery pass added by "Register sessions with no live tmux as Dormant", delete the sidecar instead of registering a dormant session when its cwd no longer exists. That is the honest signal: the directory the session lived in is gone, so nothing can be resumed there.

Leave sidecars whose directory still exists alone regardless of age — a worktree that survived is work the operator may still want back.

Sidecars are written on create and deleted on kill, and nothing else ever removes one. A session whose worktree was deleted by hand, or that died in a way that skipped the kill path, leaves a JSON file behind forever. A real host had five such orphans pointing at worktrees that no longer exist. During the recovery pass added by "Register sessions with no live tmux as Dormant", delete the sidecar instead of registering a dormant session when its `cwd` no longer exists. That is the honest signal: the directory the session lived in is gone, so nothing can be resumed there. Leave sidecars whose directory still exists alone regardless of age — a worktree that survived is work the operator may still want back.
naps62-yolo added this to the Reboot resilience milestone 2026-09-03 23:05:15 +01:00
naps62-yolo added the area/daemontype/fixdifficulty/easy labels 2026-09-03 23:05:15 +01:00
naps62-yolo added a new dependency 2026-09-03 23:06:11 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Reference: naps62/maestro#163