Skip to content

fix(new-workspace): keep an all-digits name instead of the issue title - #21679

Closed
markdlabrecque wants to merge 2 commits into
stablyai:mainfrom
markdlabrecque:markdlabrecque/21676-bug-new-workspace-naming
Closed

markdlabrecque wants to merge 2 commits into
stablyai:mainfrom
markdlabrecque:markdlabrecque/21676-bug-new-workspace-naming

Conversation

@markdlabrecque

@markdlabrecque markdlabrecque commented Sep 19, 2026 •

Copy link
Copy Markdown

Size: the production change is one line in one file (src/shared/new-workspace/work-item-lookup-text.ts, +8/-1, 2 of those lines docstrings). The other 121 lines are tests. The behaviour change only narrows what counts as an issue reference, so nothing that worked before stops working.

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 002 or 347 into 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. Type 002-x or 2- and it is honoured — so it looked like digits were fine and only the all-digits case broke.

After: 002 is kept. The workspace name, the display name, and the branch are all 002.

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() in src/shared/new-workspace/work-item-lookup-text.ts decides which is which.

It asked parseGitHubIssueOrPRNumber(), whose leading # is optional — so a bare 002 parsed 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)
  • the folder-workspace composer's submit path (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

347 is a valid Git branch name (git check-ref-format --branch 347 passes) 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:

  • Change parseGitHubIssueOrPRNumber to require #. Rejected — it is shared with the issue-link picker, the jump palette, worktree meta updates, and normalizeGitHubLinkQuery. In a link field a bare number genuinely does mean an issue number, and typing 4900 there should keep working. The ambiguity is contextual, so the fix belongs in the name-field classifier, not the parser.
  • Keep the fallback but surface an error. The issue offers this as an acceptable alternative. It is a real gap — any future name heuristic will silently discard something again — but it is a separate feature, so it is filed as a follow-up rather than folded in here.
  • Special-case digits at submit time. Rejected — it would leave the field visibly overwritten in the UI and fix only one of the three consumers.

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 named 002 rather than the linked issue's title.

Testing

Reproduce and verify manually:

  1. Open the New Workspace composer and pick a ticket from Tasks.
  2. Expand Advanced, type 002 into the Name field, create.
  3. Branch and folder are 002. On main, they are the slugified issue title.
  4. Repeat with #002 — still treated as an issue reference, auto-name still applies (unchanged).
  5. Repeat with 002-x — honoured, as before.
  6. In an issue-link field (sidebar issue link, jump palette), type 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.ts and src/renderer/src/lib/work-item-lookup-text.test.ts — bare 002 / 347 / 7 are not lookup text; #4900 and URL forms unchanged.
  • src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts — isExplicitWorkspaceNameInput accepts a bare number; #1234 still rejected.
  • src/shared/new-workspace/workspace-source.test.ts — shouldApplyWorkspaceSourceAutoName no 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 typed 002 creates the workspace as 002, 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 lint
  • pnpm typecheck
  • pnpm test (affected suites, plus the bare-number link paths as a regression check)
  • pnpm build

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

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

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 isWorkItemLookupText are fixed by the single central change (including mobile, via mobile/src/tasks/composer-linked-work-item.ts); no URL shape is lost, since parseGitHubIssueOrPRLink accepts 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 / prepareQuickSubmitSource have 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

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Agent, integration, and git-provider compatibility: unaffected and provider-neutral. isWorkItemLookupText classifies 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.
  • Security: none — no new input reaches a shell, path, or network call.
  • Cross-platform: no platform-dependent code; pure string logic.
  • Remote SSH: unaffected. Classification is renderer-side and the name is transported as it already was; sanitizeWorktreeName on the execution host is unchanged.
  • Mobile: mobile/src/tasks/composer-linked-work-item.ts calls the same shared predicate and inherits the fix — no divergence.
  • Backwards compatibility: the only behaviour change is that a bare number typed into a name field is now kept. #-prefixed and URL forms are byte-for-byte unchanged, so no wire, storage, or cross-version contract moves.
  • Performance: a startsWith check replaces a regex parse on a short string.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

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

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: a03689ea-cbe4-4c4d-a840-8602e2896e8f

📥 Commits

Reviewing files that changed from the base of the PR and between 3f25e6a and 3e3fb21.

📒 Files selected for processing (2)
  • src/renderer/src/components/sidebar/folder-workspace-composer-name-ownership.test.ts
  • src/shared/new-workspace/work-item-lookup-text.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/shared/new-workspace/work-item-lookup-text.ts
  • src/renderer/src/components/sidebar/folder-workspace-composer-name-ownership.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The 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 "002".

Priority: ➖ Normal

Severity of issue fixed: Medium

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #21676 requires the New Workspace composer to preserve all-digits names or report an explicit error. isWorkItemLookupText now treats bare numbers as names while retaining lookup behavior for `…
Out of Scope Changes check ✅ Passed The implementation and tests directly support issue #21676. The changes cover lookup classification, name preservation, auto-name protection, workspace-source naming, and workspace creation. No unrela…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 6 files.
Title check ✅ Passed The title clearly identifies the primary fix: preserving all-digits workspace names instead of replacing them with an issue title.
Description check ✅ Passed The description is complete and matches the required template. It explains the user impact, mechanism, rationale, linked issue, testing, platform considerations, AI disclosure, review notes, and check…

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ 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 — isWorkItemLookupText no longer treats 002 / 347 / 7 as lookup text. hasGitHubLookup now gates parseGitHubIssueOrPRNumber behind a new isHashPrefixedGitHubIssueOrPRNumber (value.startsWith('#') && …), while full issue/PR URLs still match through parseGitHubIssueOrPRLink.
  • No URL or #123 regression — the number parser and link parser accept the same URL set (GH_ITEM_PATH_RE + number > 0), so #4900 and every URL shape resolve exactly as before. Verified against src/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 its export * shim. Link/jump fields call parseGitHubIssueOrPRNumber directly and keep accepting bare numbers.
  • Tests can fail — the new folder-workspace test asserts createFolderWorkspace receives name: '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.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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.

[Bug]: New Workspace composer silently ignores an all-digits name and falls back to the slugified issue title

2 participants