feat: add entire sessions stop command#739
Merged
gtrrz-victor merged 10 commits intomainfrom Mar 31, 2026
Merged
Conversation
Adds `entire stop` to manually mark one or more active sessions as ended, preventing future checkpoint leakage without waiting for the agent to stop naturally or for a SessionStop lifecycle hook. Pure state mutation — no writes to the checkpoints branch, no condensation. The existing PostCommit hook handles any remaining condensation on the next commit. Flags: --session <id>, --all (worktree-scoped), --force/-f TUI multi-select for 2+ sessions; confirmation prompt for single session. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new entire stop command to manually mark one or more sessions as ended (state-only mutation) to prevent further checkpoint leakage without waiting for the agent lifecycle to naturally close the session.
Changes:
- Introduces
entire stopwith--session,--all(worktree-scoped), and--forceflows, including interactive selection when multiple sessions exist. - Adds unit tests covering the non-interactive stop flows and common error cases.
- Documents the new command in
README.mdandCHANGELOG.md, and wires it into the root command.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds entire stop to the command list. |
| cmd/entire/cli/stop.go | Implements the stop command logic (single/all/multi-select) and output messaging. |
| cmd/entire/cli/stop_test.go | Adds unit tests for stop behavior (force, flags, not-found, non-git repo, etc.). |
| cmd/entire/cli/root.go | Registers the new stop subcommand. |
| CHANGELOG.md | Notes the addition of entire stop. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ire stop - stopSelectedSessions: print ✗ per failed session to stderr so batch failures are visible immediately, not just as a joined error at the end - stopSessionAndPrint: wrap markSessionEnded error with session ID for context in both single and batch stop paths - runStopMultiSelect: warn and skip sessions concurrently removed between TUI render and confirmation; guard empty toStop after filtering - filterActiveSessions: add nil guard; document intentional dual-check vs status.go's EndedAt-only filter - handleFormCancellation: treat huh.ErrTimeout same as ErrUserAborted; wrap unexpected errors with action name for context - --session flag description: note it is not scoped to current worktree - tests: add TestStopCmd_AllFlag_ExcludesOtherWorktrees, TestStopCmd_AllFlag_NoActiveSessions, TestStopSelectedSessions_StopsAll (replaces non-executing cop-out multi-select test); add PhaseActive coverage to filter unit test; rename SingleSession_Force to clarify empty-WorktreePath intent; add ErrTimeout case to utils_test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Explicitly passing a session ID is already a deliberate action — no confirmation prompt needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduce `entire sessions` parent command to group session management. The stop command is now `entire sessions stop` with no alias for the old top-level `entire stop`. Also fixes pre-existing broken TestStopCmd_NotGitRepo assertion (expected SilentError but command returns plain error since f009902). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 454bce9f05c7
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 3a713bd16a46
entire sessions stop command
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 677601cfbf7f
`entire sessions stop <session-id>` instead of `entire sessions stop --session <session-id>`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 5ccdcb0fdb9c
nodo
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds
entire sessions stopto manually mark one or more active sessions as ended, preventing future checkpoint leakage without waiting for the agent to stop naturally.entire sessionsparent command to group session managemententire sessions stop <session-id>--all(worktree-scoped),-f/--force(skip confirmation)--all) require confirmation unless--forceis setUsage
Output
Session with a committed checkpoint:
Session with uncommitted work:
Session with no recorded work:
Test plan
mise run fmt && mise run lintpassesmise run test:cipasses (unit + integration + E2E canary)entire sessions stop --helpshows correct usage with positional arg--all, positional session ID, worktree scoping, already-stopped, not-a-git-repo, mutual exclusion of--all+ session ID arg, batch stop, legacy sessions with empty WorktreePath, confirmation prompt consistency