adds entire reset that deletes the shadow branch and session state for the current HEAD commit#134
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new entire reset command that allows users to delete the shadow branch and session state for the current HEAD commit, enabling them to start fresh without existing checkpoints. The command is implemented for the manual-commit strategy only, as the auto-commit strategy doesn't use shadow branches.
Changes:
- Adds new
entire resetcommand with--forceflag support for skipping confirmation prompts - Implements reset functionality in the ManualCommitStrategy via the SessionResetter interface
- Updates documentation and error messages to reference the new command instead of the old
entire rewind reset - Includes comprehensive test coverage for various reset scenarios
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/reset.go | New command implementation with validation for git repository and strategy support |
| cmd/entire/cli/strategy/manual_commit_reset.go | Core reset logic that finds sessions, confirms deletion, and cleans up shadow branches |
| cmd/entire/cli/reset_test.go | Comprehensive test suite covering multiple scenarios including edge cases |
| cmd/entire/cli/root.go | Registers the new reset command in the CLI |
| cmd/entire/cli/hooks_claudecode_handlers.go | Updates error messages to reference entire reset instead of entire rewind reset |
| README.md | Adds command to reference table and updates examples to use the new command name |
…r the current HEAD commit
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Entire-Checkpoint: 00c9e2351016
03ebba1 to
761c588
Compare
Entire-Checkpoint: 4c06989c549b
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.
| } | ||
|
|
||
| // Verify no shadow branch was created or exists | ||
| shadowBranch := "entire/" + commitHash.String()[:7] |
There was a problem hiding this comment.
Test uses incorrect shadow branch name format
Low Severity
The test TestResetCmd_SessionsWithoutShadowBranch constructs the shadow branch name as "entire/" + commitHash.String()[:7], but the actual shadow branch naming format used throughout the codebase is entire/<commit[:7]>-<worktreeHash[:6]> (produced by checkpoint.ShadowBranchNameForCommit). This inconsistency means the test's assertion for verifying no shadow branch exists is checking for a branch with the wrong name, making it ineffective. The other reset tests correctly use checkpoint.ShadowBranchNameForCommit(commitHash.String(), worktreeID) for consistency.


Note
Medium Risk
Adds a new destructive cleanup command that deletes local session state files and shadow branches; failures or incorrect targeting could orphan or remove in-progress session metadata.
Overview
Adds a new
entire resetcommand (with--force) to delete the current HEAD’s manual-commit shadow branch and any matching.git/entire-sessions/*.jsonstate files, allowing users to start fresh on the same base commit.Updates user-facing messaging/docs to point to
entire reset(instead of the olderrewind resetwording), wires the command into the CLI root, and adjusts theSessionResetterinterface/ManualCommitStrategy.Resetimplementation accordingly, including unit tests for common scenarios.Written by Cursor Bugbot for commit 4df8957. This will update automatically on new commits. Configure here.