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

Commit

Soph2mo ago

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

  • Refresh on checkpoint-newer: when the committed checkpoint cleanly extends the local session log (local is a prefix of it), refresh the local log from the checkpoint instead of keeping the stale copy. Covers the cross-machine "continued and pushed elsewhere" case.
  • Divergence guard: a newer checkpoint timestamp alone no longer authorizes an overwrite. If the local log holds entries the checkpoint lacks (StatusDiverged) — or is strictly newer — resume prompts before overwriting and keeps the local log when non-interactive. --force still overwrites unconditionally.
  • Remote refresh before read: fetch the checkpoint metadata branch from the remote before reading, so a remotely-updated checkpoint is picked up even when its ID already resolves locally (best-effort; offline falls back to local).
  • Progress: spinners around the metadata-branch fetch (refreshMetadataFromRemote) and on-demand blob fetches (FetchBlobsByHash), gated on CanPromptInteractively so hooks/agents/CI stay silent.

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 Entire-Checkpoint: c58158e62f02

Checkpoints

can you look at this branch / pr also in the context of https://github.com/entireio/cli/issues/1433 and especially https://github.com/entireio/cli/issues/1433#issuecomment-4722283362

Claude CodeOpus 4.8
View session
Checkpoint 1

Handle Checkpoint Updates in Resume Logic

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1