Repository navigation
fix(new-workspace): keep an all-digits name instead of the issue title - #21679
markdlabrecque wants to merge 2 commits into
Conversation
stablyai#21676) A workspace name made only of digits was classified as a GitHub issue lookup reference, because parseGitHubIssueOrPRNumber treats the leading "#" as optional. The composer then treated the typed text as auto-managed and replaced it with the slugified issue title, with no error shown. Name-field classification now requires an explicit "stablyai#123" or a full issue/PR URL. Link fields keep resolving bare numbers, since that is the correct reading there.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe lookup classifier now treats bare digit-only text as a deliberate workspace name. Hash-prefixed numbers and GitHub issue or pull-request URLs remain lookup references. Regression tests cover lookup classification, explicit composer input, auto-name preservation, and folder-workspace creation with the name Priority: ➖ Normal Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the full six-file diff of the single commit on the branch. The change narrows one shared classifier and pins it with tests; there is no behavioral surface beyond the intended one.
- Bare numbers become names —
isWorkItemLookupTextno longer treats002/347/7as lookup text.hasGitHubLookupnow gatesparseGitHubIssueOrPRNumberbehind a newisHashPrefixedGitHubIssueOrPRNumber(value.startsWith('#') && …), while full issue/PR URLs still match throughparseGitHubIssueOrPRLink. - No URL or
#123regression — the number parser and link parser accept the same URL set (GH_ITEM_PATH_RE+ number > 0), so#4900and every URL shape resolve exactly as before. Verified againstsrc/shared/github/links.ts. - All consumers are name fields — repo-wide grep confirms the predicate is only reached from
isExplicitWorkspaceNameInput,shouldApplyWorkspaceSourceAutoName, and the folder-workspace submit gate; mobile inherits through itsexport *shim. Link/jump fields callparseGitHubIssueOrPRNumberdirectly and keep accepting bare numbers. - Tests can fail — the new folder-workspace test asserts
createFolderWorkspacereceivesname: '002'; pre-fix the name was replaced by the linked issue title, so the assertion is red without the change. The predicate-level tests likewise fail against the old bare-number branch.
One intentional tradeoff worth recording: a bare number pasted into the name field no longer auto-resolves the ticket (the link field still does). That matches the linked issue's request and is called out in the PR body, with a follow-up filed for surfacing a discarded name. No action needed here.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
If you named a new workspace with just a number, like
002, Orca quietly threw that name away and used the ticket's title instead. It thought you were typing an issue number, not a name. Now it keeps your name.What Changed
Before: in the New Workspace composer, open Advanced, type
002or347into the Name field, and create. The workspace, its branch, and its folder come out named after the slugified issue title. Nothing tells you your name was dropped. Type002-xor2-and it is honoured — so it looked like digits were fine and only the all-digits case broke.After:
002is kept. The workspace name, the display name, and the branch are all002.The mechanism: the composer keeps two categories of text in that field. A deliberate name it must never touch, and a lookup reference (something you pasted to find a ticket with) that it is free to replace once it resolves the ticket.
isWorkItemLookupText()insrc/shared/new-workspace/work-item-lookup-text.tsdecides which is which.It asked
parseGitHubIssueOrPRNumber(), whose leading#is optional — so a bare002parsed as issue #2 and landed in the "lookup reference" bucket. Three places then overwrite the field or ignore it at submit:isExplicitWorkspaceNameInput(src/renderer/src/hooks/useComposerState.ts)shouldApplyWorkspaceSourceAutoName(src/shared/new-workspace/workspace-source.ts)src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts)The fix narrows the name-field test to an explicit marker:
#123, or a full issue/PR URL. A bare number in a name field is now a name.Why
347is a valid Git branch name (git check-ref-format --branch 347passes) and a valid directory name. Teams that name a branch and worktree after the ticket number alone hit the one case the composer refused, and it refused it silently — you only find out after the worktree exists and the branch is already wrong.Alternatives considered:
parseGitHubIssueOrPRNumberto require#. Rejected — it is shared with the issue-link picker, the jump palette, worktree meta updates, andnormalizeGitHubLinkQuery. In a link field a bare number genuinely does mean an issue number, and typing4900there should keep working. The ambiguity is contextual, so the fix belongs in the name-field classifier, not the parser.Linked Issue
Fixes #21676
Visual Proof
N/A— No visual change. No pixels change; The change is which string is used for the workspace/branch name. The user-visible before/after is covered by an automated test asserting the created workspace is named002rather than the linked issue's title.Testing
Reproduce and verify manually:
002into the Name field, create.002. Onmain, they are the slugified issue title.#002— still treated as an issue reference, auto-name still applies (unchanged).002-x— honoured, as before.4900— still resolves to issue Use work item titles for create-from workspace names #4900 (unchanged).Automated:
src/shared/new-workspace/work-item-lookup-text.test.tsandsrc/renderer/src/lib/work-item-lookup-text.test.ts— bare002/347/7are not lookup text;#4900and URL forms unchanged.src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts—isExplicitWorkspaceNameInputaccepts a bare number;#1234still rejected.src/shared/new-workspace/workspace-source.test.ts—shouldApplyWorkspaceSourceAutoNameno longer clobbers a bare number.src/renderer/src/components/sidebar/folder-workspace-composer-name-ownership.test.ts(new) — end-to-end: a linked issue plus a typed002creates the workspace as002, not the issue title.Each test was confirmed red against the unfixed code first.
All four checks CI runs, run locally on Linux — all green:
pnpm lintpnpm typecheckpnpm test(affected suites, plus the bare-number link paths as a regression check)pnpm buildAlso
pnpm run check:code-quality:changed— 0 new findings.Platforms: developed and tested on Linux. The change is pure string classification in shared renderer code with no path, shell, or filesystem dependency, so macOS and Windows behaviour is identical. Not manually retested on macOS/Windows/SSH.
Author
X: @marklabrec
AI Disclosure
Claude Opus 5 (Claude Code) was used for the investigation, tests, implementation, and review.
Review
Independently reviewed before opening. Verified: all three consumers of
isWorkItemLookupTextare fixed by the single central change (including mobile, viamobile/src/tasks/composer-linked-work-item.ts); no URL shape is lost, sinceparseGitHubIssueOrPRLinkaccepts exactly the same set the old number path reached; link-field callers are untouched;sanitizeWorktreeName('002')preserves the digits through to the branch and folder; and edge cases (' 002 ','# 123','##123','#0','#-5') behave the same before and after.Known coverage gap, pre-existing and out of scope:
prepareFullSubmitSource/prepareQuickSubmitSourcehave no test file anywhere in the repo. The fix is pinned at the predicate that path calls (isExplicitWorkspaceNameInput); the wiring above it is untouched. Follow-up filed.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
isWorkItemLookupTextclassifies GitHub, GitLab, Jira, and Linear references side by side; only the GitHub bare-number branch changed, and the GitLab/Jira/Linear branches are untouched — none of them ever treated a bare number as a reference. No agent-specific or integration-specific code is in this path.sanitizeWorktreeNameon the execution host is unchanged.mobile/src/tasks/composer-linked-work-item.tscalls the same shared predicate and inherits the fix — no divergence.#-prefixed and URL forms are byte-for-byte unchanged, so no wire, storage, or cross-version contract moves.startsWithcheck replaces a regex parse on a short string.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)