resume: refresh stale logs, fetch remote checkpoints, show progress · Entire

resume: refresh stale logs, fetch remote checkpoints, show progress

dbd6f31·

Soph·2w ago·7 files·+622 added/-50 removed

Improve entire resume so it reflects the latest session state and never silently loses local work:

Internal cleanup: collapse RestoreLogsOnly's two decision maps into one via decideRestoreActions; share the keep/overwrite/conflict prompt through ConfirmOverwriteNewerLocalLogs; dedupe the resume-command print in resumeSingleSession.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

c58158e62f02View transcript

Changes

7

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). branch is checked out elsewhere. By default, resume keeps an existing local session log as-is, except when the checkpoint cleanly extends it — i.e. the local log is a prefix of the checkpoint (e.g. the session was continued and pushed from another machine) — in which case it refreshes the local log from the checkpoint since only appended entries are added. If the local log is newer than the checkpoint, or the two have diverged (the checkpoint's last entry is newer but the local log holds entries the checkpoint lacks), resume prompts before overwriting and keeps the local log when non-interactive. --force overwrites unconditionally from the checkpoint. Before reading, resume fetches the checkpoint metadata branch from the remote so a remotely-updated checkpoint is picked up even when its ID already resolves locally.