resume picker: address Copilot/Cursor review comments

main

Commit

Soph3mo ago
  • TTY gate: bare entire resume now bails with guidance when there's no interactive terminal instead of opening a form that can't render (cursor, High).
  • huh form uses RunWithContext(ctx) so it honors the command context, and context.Canceled (like ErrUserAborted) exits cleanly without a noisy "selection failed" error (cursor, Medium/Low).
  • branchCheckedOutElsewhere returns false when the current worktree root can't be resolved, instead of treating every worktree (incl. the current checkout) as "elsewhere" and printing a misleading clash hint (cursor, Medium).
  • captureSessionBranch clears state.Branch on a detached HEAD so a stale branch from a previous turn can't mis-map the session on resume; the derivation fallback takes over (Copilot).
  • buildCheckpointBranchIndex defers iter.Close() on the branch iterator (Copilot).
  • resumeSingleSession doc comment updated to the keep-by-default behavior, and its kept-log message aligned to the "Keeping existing ..." wording used by the multi-session path (Copilot).

Adds TestCaptureSessionBranch (on-branch capture + detached-HEAD clear).

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

Checkpoints

Interactive Resume Picker for Sessions

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1