Skip to content

feat: entire session sub commands#822

Merged
gtrrz-victor merged 7 commits intomainfrom
feat/sessions-subcommands
Apr 1, 2026
Merged

feat: entire session sub commands#822
gtrrz-victor merged 7 commits intomainfrom
feat/sessions-subcommands

Conversation

@peyton-alt
Copy link
Copy Markdown
Contributor

@peyton-alt peyton-alt commented Apr 1, 2026

Fixes sessions stop worktree scoping bug and adds sessions list and sessions info subcommands.

sessions stop fix: The no-args and --all paths silently filtered to the current worktree, hiding sessions that entire status showed.

  • Now all active sessions are visible across all worktrees, with worktree labels in the multi-select picker for context.

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 stop semantics to operate across all worktrees (including --all), which could unexpectedly stop more sessions than before, though logic is well-covered by new tests. New list/info subcommands add output/formatting and JSON serialization but don’t touch auth or external side effects beyond reading session state.

Overview
Adds entire sessions list and entire 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 stop worktree-scoping so the no-args flow and --all operate globally across worktrees, and updates the multi-select UI to include worktree labels and truncated prompts; active-session filtering is aligned with status so sessions with PhaseEnded or EndedAt set are excluded. Test coverage is expanded to validate cross-worktree behavior plus the new list/info outputs (text + JSON) and helper label functions.

Written by Cursor Bugbot for commit 832c509. Configure here.

Copilot AI review requested due to automatic review settings April 1, 2026 00:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --all stop 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=nil attach 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.

peyton-alt and others added 6 commits March 31, 2026 20:52
- 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>
@peyton-alt peyton-alt force-pushed the feat/sessions-subcommands branch from d1a6c2e to 832c509 Compare April 1, 2026 03:53
@peyton-alt
Copy link
Copy Markdown
Contributor Author

@BugBot review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@peyton-alt peyton-alt marked this pull request as ready for review April 1, 2026 04:06
@peyton-alt peyton-alt requested a review from a team as a code owner April 1, 2026 04:06
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 gtrrz-victor enabled auto-merge April 1, 2026 06:42
@gtrrz-victor gtrrz-victor merged commit c055475 into main Apr 1, 2026
3 checks passed
@gtrrz-victor gtrrz-victor deleted the feat/sessions-subcommands branch April 1, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants