Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates entire sessions stop to operate on active sessions globally (across worktrees), aligning the stop UX with the global session visibility expected from entire status, and improves selector labeling for cross-worktree context.
Changes:
- Remove worktree scoping from the no-args and
--allstop paths so all active sessions are reachable. - Add a
sessionWorktreeLabel()helper and include worktree label in the multi-select option text. - Update/add tests for cross-worktree reachability and for filtering the
Phase=ended, EndedAt=nilattach edge case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| cmd/entire/cli/sessions.go | Makes stop operate across worktrees; adds worktree labeling helper; updates selector labels (including prompt preview truncation). |
| cmd/entire/cli/sessions_test.go | Updates --all scoping expectations; adds filterActiveSessions edge-case test; updates no-args cross-worktree stop test. |
- Remove worktree scoping from no-args and --all stop paths so all active sessions are visible, matching `entire status` behavior - Add worktree ID to multi-select labels for cross-worktree context - Add sessionWorktreeLabel() helper for consistent worktree display - Add test for filterActiveSessions attach edge case (Phase=ended, EndedAt=nil) - Update tests: cross-worktree sessions are now reachable Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shows all sessions (active and ended) across all worktrees with status-style card rendering. Includes labeled session and checkpoint IDs for easy copy-paste into other commands like explain and rewind. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Detailed session inspection showing agent, model, status, worktree, timing, token breakdown, checkpoint linkage, and files touched. Supports --json for scripting and piping into other tools. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Long description to sessions command with subcommand listing and usage examples. Use <session-id> placeholder instead of hardcoded UUIDs. Fix --all example to reflect global scope. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix stale comment on --all path (still referenced worktree scoping) - Fix UTF-8 truncation bug in multi-select: use stringutil.TruncateRunes - Fix JSON agent field: apply (unknown) fallback for legacy sessions - Add tests for sessions list (no sessions, all sessions, sort order, not-git-repo) - Add tests for sessions info (text output, JSON output, ended session, not found, not-git-repo) - Add tests for sessionWorktreeLabel and sessionPhaseLabel helpers - Extract test constants for repeated string literals Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split combined nil-or-phase checks into separate t.Fatal (nil guard) and t.Errorf (phase check) to prevent panic when loaded is nil. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d1a6c2e to
832c509
Compare
Contributor
Author
|
@BugBot review |
Move the WorktreeRoot check from each subcommand (list, info, stop) into the parent sessions command's PersistentPreRunE so all current and future subcommands get it automatically. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 1b2588bb0535
gtrrz-victor
approved these changes
Apr 1, 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.
Fixes
sessions stopworktree scoping bug and addssessions listandsessions infosubcommands.sessions stop fix: The no-args and --all paths silently filtered to the current worktree, hiding sessions that entire status showed.
sessions list: Shows all sessions (active and ended) in status-style card format with labeled session and checkpoint IDs for easy copy-paste into explain, rewind, and info.
sessions info : Detailed session inspection — agent, model, status, worktree, timing, token breakdown, checkpoint linkage, and files touched. Supports --json for scripting.
Note
Medium Risk
Changes
sessions stopsemantics to operate across all worktrees (including--all), which could unexpectedly stop more sessions than before, though logic is well-covered by new tests. Newlist/infosubcommands add output/formatting and JSON serialization but don’t touch auth or external side effects beyond reading session state.Overview
Adds
entire sessions listandentire sessions info <id>(with optional--json) to browse all tracked sessions and inspect a single session’s full state, including token breakdown, checkpoint linkage, worktree metadata, and files touched.Fixes
sessions stopworktree-scoping so the no-args flow and--alloperate globally across worktrees, and updates the multi-select UI to include worktree labels and truncated prompts; active-session filtering is aligned withstatusso sessions withPhaseEndedorEndedAtset are excluded. Test coverage is expanded to validate cross-worktree behavior plus the newlist/infooutputs (text + JSON) and helper label functions.Written by Cursor Bugbot for commit 832c509. Configure here.