fix: make entire clean --all clean all sessions, not just orphaned#846
Open
peyton-alt wants to merge 2 commits intomainfrom
Open
fix: make entire clean --all clean all sessions, not just orphaned#846peyton-alt wants to merge 2 commits intomainfrom
entire clean --all clean all sessions, not just orphaned#846peyton-alt wants to merge 2 commits intomainfrom
Conversation
Previously, `--all` only found orphaned sessions (those with no shadow branch AND no checkpoints). Active sessions were invisible to `--all`, so users had to use `--session <id>` to clean them individually. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: cb0888567b77
Contributor
There was a problem hiding this comment.
Pull request overview
Updates entire clean --all so repo-wide cleanup includes all session state files (not only orphaned ones), addressing cases where active sessions were previously invisible to --all.
Changes:
- Added
strategy.ListAllItems()to enumerate all session state files plus shadow branches for full repo cleanup. - Updated
clean --allhelp text/output and wiredrunCleanAllto use the new listing behavior. - Added/updated tests to cover the new
--allbehavior and adjusted expected user-facing messaging.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cmd/entire/cli/strategy/cleanup.go | Adds ListAllItems() to list all session states (and shadow branches via strategy). |
| cmd/entire/cli/clean.go | Switches --all to use the new full listing; updates help text and “no items” messaging. |
| cmd/entire/cli/clean_test.go | Updates assertions for revised messages and adds a regression test ensuring sessions with shadow branches are cleaned by --all. |
- Use ListShadowBranches directly instead of ListOrphanedItems to avoid fragile coupling to orphan-detection logic - Remove dead ListAllCleanupItems function (no callers after prior commit) - Fix Short description still referencing "orphaned" - Remove listTempFiles active-session filter for --all path since those sessions are being deleted anyway (use listAllTempFiles instead) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 14ecffdcb72a
Contributor
Author
|
@BugBot review |
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.
Previously,
--allonly found orphaned sessions (those with no shadow branch AND no checkpoints). Active sessions were invisible to--all, so users had to use--session <id>to clean them individually.Note
Medium Risk
entire clean --allnow deletes all session state files and shadow branches (including previously “active”/non-orphaned sessions), increasing the blast radius if run unintentionally. Behavior is covered by updated messaging and a regression test, but still impacts user data cleanup semantics.Overview
Updates
entire clean --allto perform a full repo-wide session cleanup instead of only removing orphaned data: it now enumerates all session state files and all shadow branches via newstrategy.ListAllItems.Temp file handling is aligned with the new semantics by listing all files under
.entire/tmp/(no active-session filtering), and user-facing help/output text and tests are updated accordingly, including a regression test ensuring sessions with shadow branches are cleaned.Written by Cursor Bugbot for commit 1f42ebf. Configure here.