Add interactive resume picker for stopped/idle sessions · Entire
Add interactive resume picker for stopped/idle sessions
605ece8 · Soph · 1mo ago · 12 files · +838 added / -240 removed
entire resume with no argument now opens an interactive picker of resumable sessions across all worktrees, so you don't have to remember which branch you left work on. Picking a session checks out its branch and prints the command to continue the agent; if the branch is already checked out in another worktree, it points you there instead of failing a checkout. entire resume <branch> is unchanged.
Details:
- Resumable = any session not currently mid-turn (idle + ended), not just sessions explicitly ended via
session stop. Exiting an agent leaves a session idle (only a real SessionEnd marks it ended), so idle is the common "walked away" case and must be included. - Adds a
Branchfield to session state, captured on each turn start, and surfaced insession list --json. For sessions recorded before the field existed, the branch is derived by matching the session's last checkpoint ID against branch-only commit trailers. Internalentire/refs (metadata branch + shadow branches) are excluded from that index, both to avoid mis-resolving to a non-resumable ref and to keep the scan fast (the index is also built lazily and avoids go-git MergeBase). - Resume now keeps an existing local session log as-is by default; only a missing log is restored from the checkpoint.
--forceoverwrites. This is driven by file existence, not transcript timestamps.
Tests
Tests cover the picker filtering/sorting, labels, branch derivation, internal-ref exclusion, worktree-clash detection, and keep-existing-log behavior. Obsolete overwrite-prompt tests removed; timestamp resume integration tests updated to keep-by-default semantics.
Changes
12
MCLAUDE.md +6/-1
cmd/entire/cli
- integration_test
- Dresume_interactive_test.go -155
- Mresume_test.go +44/-38
- Mresume.go +26/-27
- Aresume_picker.go +344
- integration_test
Commands
session(alias:sessions):list,info,stop,attach,resume,current
resume with a branch arg switches to it and resumes its session; with no arg it opens an interactive picker of stopped sessions (across all worktrees), resolving each to its branch and pointing at the owning worktree when the branch is checked out elsewhere. Resume keeps an existing local session log as-is by default (--force overwrites it from the checkpoint).
2. checkpoint (aliases: cp, checkpoints): list, explain, search, plus the deprecated rewind (functional, prints a cobra deprecation message, will be removed in a future release)