Repository navigation
fix(worktrees): use a typed workspace name as its branch again - #35815
Conversation
#32919 gave typed workspace names a creature placeholder branch so first-work naming could rename it. When generation fails or never runs, users are left on branches like geoduck instead of the name they typed. Typed names are valid branches in any script, so use them directly; auto-rename keeps applying to Orca-generated creature names only.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
[Medium impact] The change affects branch naming in desktop and runtime workspace creation. Fix the FindingsSummaryThis PR restores sanitized typed workspace names as branches on desktop and runtime creation paths.
Reviews (1) · Last reviewed commit: "fix(worktrees): use a typed workspace na..." · Reviewed by Greptile |
| selectedExistingLocalBranchName ?? | ||
| getBranchNameOverrideCandidate(args.request.branchNameOverride, suffix), | ||
| branchSeed ? getWorktreeCreateCandidate(branchSeed, suffix) : effectiveSanitizedName, | ||
| effectiveSanitizedName, |
There was a problem hiding this comment.
With auto-rename enabled, typing package.lock now makes workspace creation fail on both desktop and runtime paths. sanitizeWorktreeName preserves the .lock ending, and computeValidatedBranchName checks only the prefix. Git rejects the resulting branch. Previously, this request used a valid creature placeholder.
Make the typed seed Git-safe before passing it here, and cover this case in both creation tests.
| { name: '認証を修正', displayName: '認証を修正', displayNameKind: 'user' }, | ||
| { name: 'fix-authentication', displayNameKind: 'user' }, | ||
| { name: 'nautilus', nameWasGenerated: true } | ||
| { name: 'fix-authentication', displayNameKind: 'user' } |
There was a problem hiding this comment.
Typed creature names still change
The typed-name fix still misses names such as nautilus. Both create paths now use that typed name as the branch, but first-work rename checks only whether the branch looks like a creature name. canRenameOrcaCreatedBranch does not distinguish typed names from generated names, so the first agent task still replaces this deliberately typed branch.
Preserve that distinction when deciding whether to rename, and add a typed creature-name case beside the generated-name test.
Problem
Since #32919 (v1.4.243), when "Auto-rename branch from work" is on (the default), a workspace name you type only sets the sidebar label. The branch gets a creature placeholder (e.g.
geoduck), and Orca relies on first-work generation to rename it. When generation fails (e.g. the agent provider returns 503), never runs, or the setting is turned off later, the user is stuck ongeoduckinstead of the name they typed.Change
selectWorktreeCreateBranchSeed. The desktop (worktree-remote.ts) and runtime (runtime-local-worktree-create-candidate.ts) create paths use the sanitized typed name as the branch again.sanitizeWorktreeNamekeeps Unicode letters, so認証を修正is a valid branch.Tests
worktrees-create-first-work-rename.test.ts, a near-duplicate ofworktrees-create-label-only-first-work.test.ts.pnpm test:changed: 9136 passed, 0 failed.tc:node, oxlint and oxfmt are clean.An independent sub-agent review of the change concluded "ship with small test cleanups"; those cleanups are included.