Skip to content

fix(worktrees): use a typed workspace name as its branch again - #35815

Merged
nwparker merged 1 commit into
mainfrom
nwparker/typed-name-branch
Oct 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/typed-name-branch

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​81 $\color{#cf222e}{\Huge{\mathbf{−}}}$​271 $\color{#cf222e}{\Huge{\mathbf{−}}}$​190
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12 $\color{#cf222e}{\Huge{\mathbf{−}}}$​48 $\color{#cf222e}{\Huge{\mathbf{−}}}$​36

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 on geoduck instead of the name they typed.

Change

  • Remove 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.
  • Auto-rename still applies only to Orca-generated creature names, which matches the setting's copy ("Rename the auto-generated branch…").
  • Keep workspace labels independent of automatic branch names #32919's language concern doesn't need a placeholder: sanitizeWorktreeName keeps Unicode letters, so 認証を修正 is a valid branch.

Tests

  • Typed names (Japanese and Latin) keep their branch through first work, on both the desktop and runtime paths.
  • Generated creature names are still renamed on first work.
  • Removed worktrees-create-first-work-rename.test.ts, a near-duplicate of worktrees-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.

#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.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fb4b5f89-87ad-4445-a118-66428aa1d311
Commits

Reviewing files that changed from the base of the PR and between 7d0982d and f8b745c.

Files selected for processing: 7
  • src/main/ipc/worktree-remote.ts
  • src/main/ipc/worktrees-create-first-work-rename.test.ts
  • src/main/ipc/worktrees-create-label-only-first-work.test.ts
  • src/main/runtime/runtime-local-worktree-create-candidate.ts
  • src/main/runtime/runtime-local-worktree-create.test.ts
  • src/main/worktree-create-branch-seed.ts
  • src/main/worktree-create-first-work-test-harness.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects branch naming in desktop and runtime workspace creation.

Fix the .lock creation failure before merging; the typed creature-name gap is a smaller follow-up.

Findings

  1. P1 Names ending in `.lock` fail ▶
  2. P2 Typed creature names still change ▶

Summary

This PR restores sanitized typed workspace names as branches on desktop and runtime creation paths.

  • Typed workspace names now become branch names on both create 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Names ending in .lock fail

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.

Comment on lines 18 to +19
{ name: '認証を修正', displayName: '認証を修正', displayNameKind: 'user' },
{ name: 'fix-authentication', displayNameKind: 'user' },
{ name: 'nautilus', nameWasGenerated: true }
{ name: 'fix-authentication', displayNameKind: 'user' }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

@nwparker
nwparker merged commit f5a4a72 into main Oct 29, 2026
46 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