Skip to content

Stop showing raw thread IDs as environment names - #3660

Merged
ymichael merged 1 commit into
mainfrom
bb/hide-raw-thread-ids-thr_gnejse5r92
Sep 14, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/hide-raw-thread-ids-thr_gnejse5r92

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A thread in the personal project runs in a personal-workspace environment, which has neither a name nor a branch. resolveEnvironmentDisplayName therefore fell through to the workspace folder's basename — and that basename is the environment provider's instance key, which the server sets to the thread ID (thread-environment-placement.ts, environmentProviderInstanceKey: context.thread.id). So every personal thread was labelled with a raw thr_… ID in mobile Recents and in the reuse-environment picker. The folder-name step was introduced in #3227; before that the label was branchName ?? name, which was simply empty for these rows.

What changed

resolveEnvironmentDisplayName in packages/core-ui/src/environment-display.ts now names a provider-backed environment by its provider display name and uses the workspace folder only for environments with no provider:

name ?? branchName ?? (providerId === null ? basename(path) : providerDisplayName)

A personal thread now reads Personal workspace instead of thr_5b9tupt9ej. resolveWorkspaceFolderName is no longer exported; it is reachable only through the resolver.

Deleting the folder step outright was the simpler change, but it regressed provider-less environments (legacy rows predating #3227, which exist in real installs): with no provider label to fall back to, they degraded to the generic "Environment". Gating the step keeps them named by their folder.

Two deliberate consequences:

  • A branchless worktree environment now shows its provider name (Worktree) instead of the checkout folder name (bb) in the sidebar environment group header.
  • While the provider list is still loading, a branchless provider-backed environment renders no name instead of briefly showing the folder — which is what stops thr_… flashing during that window.

No wire, schema or CLI changes; HOST_DAEMON_PROTOCOL_VERSION is unchanged.

How you verified

  • packages/core-ui/test/environment-display.test.ts: the case that asserted thr_k72wqg7tcs now asserts Personal workspace, plus new cases for the loading window and for provider-less directory attachments. They fail against the previous resolver.
  • pnpm exec turbo run typecheck lint test --filter='...[origin/main]': 118 of 121 tasks pass (@bb/app lint reports only pre-existing react-compiler warnings, 0 errors). @bb/integration-tests failed with ~10 suites hitting their 60s timeout; a pnpm start:worktree instance was running in the same checkout during the run, and this change is a pure display-string helper with no server, daemon or provider surface, so the timeouts are contention rather than a regression. Worth confirming from CI.
  • Manual, in an isolated dev instance driven through the browser, with the same seeded data on both builds — the fix reverted, then restored:
    • Mobile Recents: thr_zymfj7m9z6 · 4m ago → Personal workspace · just now.
    • Reuse-environment picker: chip and menu rows thr_hxbeuzp4r9 / thr_zymfj7m9z6 → Personal workspace.
    • Sidebar environment group header, branchless worktree row: scratch-notes → Worktree.
    • Provider-less directory attachment: scratch-notes on both builds, confirming parity.

🤖 Generated with Claude Code

AGENT GENERATED

A personal-project thread runs in a personal-workspace environment with
no name and no branch, so resolveEnvironmentDisplayName fell through to
the workspace folder basename. That basename is the provider instance
key, which the server sets to the thread ID, so mobile Recents and the
reuse-environment picker rendered rows like "thr_5b9tupt9ej".

Name provider-backed environments by their provider display name
("Personal workspace") and keep the folder fallback only for
provider-less directory attachments, whose folder is the only thing
identifying them.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@ymichael
ymichael merged commit c8c7fab into main Sep 14, 2026
16 checks passed
@ymichael
ymichael deleted the bb/hide-raw-thread-ids-thr_gnejse5r92 branch September 14, 2026 22:50
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