feat(worktree): auto-rescue dirty worktrees during cleanup#356
Open
dimakis wants to merge 2 commits into
Open
Conversation
…aft PR Add rescueDirtyWorktree() that programmatically rescues stale worktrees with uncommitted work: stages all changes, commits, pushes, and creates a draft PR via gh CLI. Wired into cleanupStaleWorktrees so rescue is attempted before falling back to the existing skip-and-notify behavior. Also updates the CLOSEOUT_PROMPT in chat.ts to instruct the agent to push branches and create PRs during session closeout, reducing the number of dirty worktrees that need rescue. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- getMcpConfigPaths() now reads ~/.claude.json (same mcpServers format as Cursor) so context7 and other globally-configured MCP servers are available in Mitzo sessions - Fix readonly tuple incompatibility with execFileSync in rescueDirtyWorktree Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dimakis
commented
May 22, 2026
Owner
Author
dimakis
left a comment
There was a problem hiding this comment.
Centaur Review
LGTM — no issues found.
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.
Summary
rescueDirtyWorktree()which stages all changes, commits them, pushes the session branch, and creates a draft PR viagh pr create, then posts the PR URL to the mgmt inbox.Test plan
server/__tests__/rescue-worktree.test.tscoversgetRepoRemote()(SSH/HTTPS parsing, error cases) andrescueDirtyWorktree()(success path, failure at each step)🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com