Skip to content

feat(host): name a PR workspace's local branch after the PR branch - #7

Merged
kermitsxb merged 2 commits into
mainfrom
feat/pr-local-branch-name
Oct 1, 2026
Merged

kermitsxb merged 2 commits into
mainfrom
feat/pr-local-branch-name

Conversation

@kermitsxb

Copy link
Copy Markdown
Owner

Why

Orca names a new worktree's branch after the workspace title (<user>/pr-12-fix-login), so a PR workspace's local branch never matched the PR's remote branch.

What

  • Host: right after a PR workspace is created (every action: Review, Checkout only, Continue work, Address comments, Custom), git branch -m <head_ref> renames the local branch, before the upstream is set. Orca has no CLI flag for the branch name.
  • Name taken: git allows a branch in one worktree only. When the rename is refused (branch checked out in your clone or in the PR's other workspace, fork branch named like a local one, leftover branch), the workspace keeps Orca's name and the response carries a warning: Local branch kept as <orca-branch>: <head_ref> already exists. The agent still starts.
  • GitCli.fastForward and the new renameBranch share a tolerateRefusal helper (refusal → false, timeout still throws).
  • Extension: the warning toast no longer says (reused) for a new workspace.
  • Reused workspaces are not renamed.

Known limit: Orca's setup hooks run during worktree create, so they still see Orca's branch name.

Tests

  • npm test (258 passed), npm run typecheck, npm run build, npm run lint:firefox (0 errors; 2 existing warnings about data_collection_permissions).
  • Not yet checked live against Orca: see the two new manual checklist items in the README.

Orca names the branch after the workspace title. Rename it to the PR's
head ref right after creation; when git refuses (name checked out in
another worktree, or already taken), keep Orca's name and warn.
@kermitsxb
kermitsxb marked this pull request as ready for review October 1, 2026 13:32
@kermitsxb
kermitsxb merged commit d2009c5 into main Oct 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant