Fix rename_worktree refusing every freshly created worktree - #293
Merged
Conversation
The published-branch guard treated any configured upstream as proof the branch had been pushed. Git's default branch.autoSetupMerge points a branch cut from origin/main at origin/main, so every new worktree looked published and the kickoff-prompt rename flow failed 100% of the time. Check for a remote ref named after the branch itself instead, which also catches a plain `git push origin <branch>` that never set an upstream. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
frenchie4111
force-pushed
the
s-bug-new-kickoff-prompt
branch
from
August 22, 2026 00:24
4033b30 to
1c0bda4
Compare
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
renameWorktreeBranchrefused the rename whenever@{upstream}was set. Git's defaultbranch.autoSetupMergepoints a branch cut fromorigin/mainatorigin/main, so every worktree Ness creates looked already-published — the kickoff-prompt rename flow failed 100% of the time withbranch "..." is already published (tracking origin/main).refs/remotes/*/<branch>), falling back to the upstream only when the upstream names that same branch. That also closes a hole in the old check: a plaingit push origin <branch>updates the remote-tracking ref without setting an upstream, and used to sail straight through.src/main/worktree-rename.integration.test.ts— real git, no mocks.Test plan
npx vitest run src/main/worktree-rename.integration.test.ts— renames succeed for a fresh branch trackingorigin/mainand for a slash-containing name; still refused afterpush -u, after a plainpush, and for a published slashed branch; target-name collision still reports the existing branch.npm run typechecknpx electron-vite buildnpx vitest run— remaining failures (git-ops-state,path-fix,worktree-watcher) are pre-existing timeouts under parallel load and pass in isolation.for-each-refglob against this repo: the unpushed branch matches nothing,mainmatches all seven remotes' refs.Note: a running Ness carries the old main-process code, so the tool keeps refusing until the app restarts on this build.
🤖 Generated with Claude Code