[Bug]: Advanced → Branch name set to a remote-only branch silently creates <branch>-2 from the base ref instead of checking out origin/<branch> · Issue #31535 · stablyai/orca · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Advanced → Branch name set to a remote-only branch silently creates <branch>-2 from the base ref instead of checking out origin/<branch> #31535
1.4.237 (macOS desktop app, worktree created on a remote Linux host over SSH; orca --version on the host reports 1.4.237)
Details
Short summary
Creating a worktree for a branch that exists only on the remote (origin/<branch>, no local ref) cannot be done from the Create Worktree dialog. Typing the branch name under Advanced → Branch name does not check that branch out: Orca silently creates a new branch with a -2 suffix cut from the repo base ref. There is no warning that the typed name was changed or that the remote branch was ignored.
Leave Branch from on the repo base ref (origin/develop).
Expand Advanced, set Branch name to a branch that exists on origin but has no local ref (e.g. feature/foo). The Reuse branch checkbox does not appear, as expected for remote-only refs.
Create.
Result: the worktree opens on a fresh branch (feature/foo-2) based on origin/develop, with none of the remote branch's commits. No toast or dialog explains that the requested name was not used.
Expected
Either of:
Orca fetches origin/feature/foo and creates local feature/foo tracking it (what the docs promise for "An existing remote branch — Orca will fetch and check it out" on the Worktrees page), or
the dialog refuses the name and says the branch exists on the remote, instead of quietly renaming it.
Why it happens (from a read of main)
In src/main/runtime/runtime-local-worktree-create-candidate.ts (same logic in src/main/ipc/worktree-remote.ts for SSH hosts):
canCheckoutExistingLocalBranch only checks refs/heads/<branch>, so a remote-only branch is never eligible for reuse.
getBranchConflictKind then reports 'remote' because origin/<branch> exists and the selected base ref is not that branch.
A remote conflict just hits continue, so the loop bumps the suffix and creates <branch>-2. The WorktreeCreateCollisionError ("already exists on a remote") is only thrown if every suffix attempt fails, which never happens in practice.
The only way the explicit name resolves to the remote branch is when Branch from is set to exactly origin/<branch> as well, because buildRemoteBranchConflictRefs excludes allowedBaseRef. Nothing in the UI hints that both fields must agree.
Suggested fix
When the explicit branch name (or the selected ref) matches a remote-only branch, create a local tracking branch from it instead of treating it as a conflict, or
show the Reuse branch option for remote refs and have it fetch + track, and
never silently suffix a name the user typed explicitly; surface the collision instead.
I’m investigating this with focused regressions for both local and SSH worktree creation. I’ll keep the scope to explicit remote-only branch names: adopt or surface that branch rather than silently suffixing it, while preserving the existing collision behavior for generated names.
Activity
Pr1p commentedon Oct 21, 2026
I’m investigating this with focused regressions for both local and SSH worktree creation. I’ll keep the scope to explicit remote-only branch names: adopt or surface that branch rather than silently suffixing it, while preserving the existing collision behavior for generated names.