Skip to content

fix: make entire clean --all clean all sessions, not just orphaned#846

Open
peyton-alt wants to merge 2 commits intomainfrom
fix/clean-all-sessions
Open

fix: make entire clean --all clean all sessions, not just orphaned#846
peyton-alt wants to merge 2 commits intomainfrom
fix/clean-all-sessions

Conversation

@peyton-alt
Copy link
Copy Markdown
Contributor

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

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.


Note

Medium Risk
entire clean --all now 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 --all to 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 new strategy.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.

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
Copilot AI review requested due to automatic review settings April 3, 2026 15:42
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 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 --all help text/output and wired runCleanAll to use the new listing behavior.
  • Added/updated tests to cover the new --all behavior 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
@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 3, 2026 16:34
@peyton-alt peyton-alt requested a review from a team as a code owner April 3, 2026 16:34
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.

2 participants