Skip to content

fix(web): new worktree threads no longer say "checkout" during setup - #13590

Merged
t3dotgg merged 1 commit into
mainfrom
t3code/fix-worktree-setup-checkout-label
Sep 25, 2026
Merged

t3dotgg merged 1 commit into
mainfrom
t3code/fix-worktree-setup-checkout-label

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

When you start a thread in a new worktree, the bar under the composer said "Local checkout" (sometimes "Current checkout") while the worktree was still being set up. That made it look like the agent would run in the main checkout.

The server creates the thread before the worktree exists, so the thread has no worktree path during checkout. The toolbar read "no path" as the project checkout. Now a thread that is still preparing its worktree counts as worktree mode, and the locked label says "New worktree". It switches to "Worktree" when checkout finishes.

ChatView also passes its env mode to the toolbar now, so the toolbar no longer works out its own. That covers the short window before the thread detail loads, where the toolbar showed "Current checkout".

Before After
Composer bar says Local checkout during worktree setup Composer bar says New worktree during worktree setup

Proof: I used a repo with a slow post-checkout hook to hold the checkout step open. In the web dev client, the bar went "New worktree" → "Local checkout / main" before this change. With the change it went "New worktree / From main" → "Worktree / t3code/…". Unit tests, typecheck, and lint pass.

🤖 Generated with Claude Code using Claude Opus 5.5

Summary by CodeRabbit

  • Bug Fixes
    • Workspace indicators now reflect the selected mode, showing the worktree icon and “New worktree” label when a worktree is being prepared, even before it is attached.
    • Locked workspace labels now distinguish between a new worktree and a local checkout, with icons matching the active workspace mode.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.5 KiB −33 B (−0.2%) 15.1 KiB ✅
Codex Thread snapshot wire 7.1 KiB 7.1 KiB −5 B (−0.1%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.5 KiB 6.4 KiB −28 B (−0.4%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 56.3 KiB 56.2 KiB −44 B (−0.1%) 66.4 KiB ✅
Codex Live turn messages 10 9 −1 (−10.0%) 21 ✅
Claude Total thread wire 13.5 KiB 13.5 KiB −6 B (−0.0%) 15.1 KiB ✅
Claude Thread snapshot wire 7.1 KiB 7.1 KiB +9 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.4 KiB 6.4 KiB −15 B (−0.2%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.0 KiB 57.0 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 9 9 0 (0.0%) 21 ✅

Baseline: b3de243 · PR result: e8f9a37 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 114.0 KiB
  • Claude decoded thread snapshot: 114.7 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 460a4663-89b3-4dea-8af4-201ef4cf43d9

📥 Commits

Reviewing files that changed from the base of the PR and between d10bd13 and d4d4e4bbab8681af6ba3dcfd76f204a3e06d6396.

📒 Files selected for processing (5)
  • apps/web/src/components/BranchToolbar.logic.test.ts
  • apps/web/src/components/BranchToolbar.logic.ts
  • apps/web/src/components/BranchToolbar.tsx
  • apps/web/src/components/BranchToolbarEnvModeSelector.tsx
  • apps/web/src/components/ChatView.tsx

Included review availability: 6 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

The toolbar now receives a resolved environment mode that accounts for worktree preparation. Its locked display uses the mode and active worktree path to choose the workspace label and icon.

Changes

Workspace mode

Layer / File(s) Summary
Resolve mode during worktree preparation
apps/web/src/components/BranchToolbar.logic.ts, apps/web/src/components/ChatView.tsx, apps/web/src/components/BranchToolbar.logic.test.ts
For server threads, worktree preparation now selects worktree mode when no worktree path is attached. ChatView passes the preparation state to the resolver. Tests cover preparation in progress and the omitted state.
Pass the resolved mode through the toolbar
apps/web/src/components/BranchToolbar.tsx, apps/web/src/components/ChatView.tsx
BranchToolbar now requires envMode and derives effective mode from it or forceNewWorktree. ChatView always passes envMode, and the branch selector always receives the derived mode.
Render the locked workspace label and icon
apps/web/src/components/BranchToolbar.logic.ts, apps/web/src/components/BranchToolbarEnvModeSelector.tsx, apps/web/src/components/BranchToolbar.tsx, apps/web/src/components/BranchToolbar.logic.test.ts
The locked workspace label now depends on the effective mode when no worktree is attached. The selector uses the active worktree path and effective mode to choose the label and icon. Tests cover the “New worktree” label.

Priority: ⚪ Not assessed

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: chrisdeeming

Merge Risk: ⚪ Minimal · up to d4d4e

The toolbar should show “New worktree” during setup and “Worktree” once the path is available. No issue requiring a fix before merge is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: correcting the worktree label during setup.
Description check ✅ Passed The description explains what changed, why it changed, the UI impact, before-and-after screenshots, testing performed, and the observed behavior. It does not use the template headings or include the c…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@macroscopeapp

macroscopeapp Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at d4d4e4b

Macroscope's review found this PR approvable — This is a narrowly scoped web bug fix that corrects workspace labeling during worktree creation and adds focused unit tests. It does not introduce a new capability, alter product defaults, change schemas, or affect the underlying worktree execution flow.

No code changes detected at e8f9a37. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

While the server checks out a new worktree, the thread exists but has no
worktree path yet. The composer bar read that as the project checkout and
showed "Local checkout" (or "Current checkout" before the thread detail
loaded). It now shows "New worktree" until the worktree is ready.

ChatView now passes its resolved env mode to the toolbar, so both use the
same value.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@t3dotgg
t3dotgg force-pushed the t3code/fix-worktree-setup-checkout-label branch from d4d4e4b to e8f9a37 Compare September 25, 2026 06:59
@t3dotgg
t3dotgg merged commit 13d6b30 into main Sep 25, 2026
24 checks passed
@t3dotgg
t3dotgg deleted the t3code/fix-worktree-setup-checkout-label branch September 25, 2026 07:03
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 25, 2026
## What's Changed
* feat(web): control Android foldables in the Device panel by @juliusmarminge in pingdotgg/t3code#13534
* fix(mcp): preview snapshots fit in the agent's tool output again by @t3dotgg in pingdotgg/t3code#13558
* fix(web): paste after clicking away from the composer lands in it again by @t3dotgg in pingdotgg/t3code#13553
* feat(desktop): keep running threads synced in the background by @t3dotgg in pingdotgg/t3code#13554
* fix(mcp): preview errors tell agents what to do instead by @t3dotgg in pingdotgg/t3code#13559
* feat(web): agents working banner links to the Agents panel by @t3dotgg in pingdotgg/t3code#13572
* fix(web): size the Android fold model from the inner display by @juliusmarminge in pingdotgg/t3code#13574
* fix(clients): a preview app no longer knocks the desktop's own server offline by @t3dotgg in pingdotgg/t3code#13577
* fix(web): keep nested task states out of parent bullets by @dominic-r in pingdotgg/t3code#11477
* feat(release): ship a Linux .deb that updates itself by @t3dotgg in pingdotgg/t3code#13575
* perf(desktop): cache compiled JavaScript between launches by @t3dotgg in pingdotgg/t3code#13501
* fix(dev): one t3.json setup action that works on every OS by @t3dotgg in pingdotgg/t3code#13589
* fix(web): new worktree threads no longer say "checkout" during setup by @t3dotgg in pingdotgg/t3code#13590
* fix(desktop): `t3 app` keeps working after a second desktop app quits by @t3dotgg in pingdotgg/t3code#13585
* fix(usage): price Claude fast-mode requests at the fast rate by @t3dotgg in pingdotgg/t3code#13599
* fix: update OpenAI logo to current brand asset by @aaditagrawal in pingdotgg/t3code#13611
* fix(mobile): render assigned project icons in chat list by @SunkenInTime in pingdotgg/t3code#12810

## New Contributors
* @aaditagrawal made their first contribution in pingdotgg/t3code#13611

**Full Changelog**: pingdotgg/t3code@v0.0.43-nightly.20260925.2237...v0.0.43-nightly.20260925.2251

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.43-nightly.20260925.2251
fireboltdude1357 pushed a commit to fireboltdude1357/t3code that referenced this pull request Sep 26, 2026
Merges origin/main (a21b42c) into t3code/codex-turn-mapping so V2
carries main's fixes. A merge rather than a rebase keeps the 715 V2
commits and the stacked PRs on this branch intact.

Conflict resolutions that change V2 code:
- server.ts: keep V2's layer graph; add main's ReplayMarkers layer next to
  the other background layers.
- serverRuntimeStartup.ts: keep V2's imports plus main's flushCompileCache.
- bin.ts: keep V2's thin entry (the command list lives in binCli.ts).
- ProjectionSnapshotQuery (V1): drop the second shell-snapshot decode
  (pingdotgg#13693); do not add listThreadsWithPullRequests (V2's PR sync does
  not read the V1 table it queries).
- PullRequestSyncReactor, ThreadPullRequestService: keep V2's versions.
- CursorDriver / cursorUsageLimits: keep V2's SDK-based driver and pass
  main's cursorKeychainUsageEnabled opt-in through to usage limits.
  Main's lowercase cursorCredentialStore.ts collides by case with V2's
  CursorCredentialStore.ts, so it becomes cursorKeychainToken.ts.
- Chat width (pingdotgg#11594): keep V2's chat-content-lane markup; main's
  settings row sits next to V2's composer-context row.
- pingdotgg#13590 env-mode label: V2's thread details panel now passes envMode
  through to BranchToolbar like the composer strip does.
- Sidebar provider stack badge uses main's text-5xs token instead of
  V2's one-off 7px class (same size).
- Deleted-in-V2 V1 files that main modified stay deleted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
aorwall added a commit to aorwall/t3code that referenced this pull request Sep 27, 2026
Merges `pingdotgg/t3code` up to `eeea71a88` (55 commits after base
`ebdcda135`). This PR is based on `main`; no other merge PR is open.

## Resolution
- **Files that landed:** 271, against 272 in the upstream range. The one
missing is `apps/server/src/cli/pair.ts`, which stays deleted under
`deletedUpstreamPaths`. The fork delta is 756 files, the same as the
last merge.
- **Conflicts (4):**
  - `apps/server/src/cli/pair.ts` (modify/delete): kept deleted.
- `ProviderSettingsPanel.tsx`, `SettingsSidebarNav.tsx`,
`useAvailableSettingsSearchItems.ts` (converged): kept the fork's gates,
search filters and feature-flag read. Took upstream's `scopeSearch`
argument and `cursorKeychainUsageEnabled` prop.
- **New fork gate:** the `cursor-keychain-usage` search item from pingdotgg#13714
is now `providerConfigurationOnly`, because its row sits inside
`UsageProviderSettings`, which the fork hides. Upstream's test now
asserts against `FEATURES.providerConfiguration` and gained the fork's
`forgejoEnabled` field. That field was the only typecheck failure.
- **Lockfile:** re-derived with `install.mjs`. The install left it
unchanged, and the fork's edges are present.
- **Sweep:** new upstream files matched none of the owned-concern
keywords, and upstream added no workflows.
- **Unsupported methods:** nothing to add or drop.

## Verification
The full `verify.mjs` run passes all 10 checks: duplicate-adds,
tripwires, resolution-check, unsupported-methods, lockfile, fmt, lint,
typecheck, build and test.

## Usable as-is
- Chat width setting (a client setting) (pingdotgg#11594)
- The "agents working" banner links to the Agents panel (pingdotgg#13572)
- Composer fixes: paste lands in the composer after clicking away
(pingdotgg#13553), the collapsed composer bar keeps its labels while scrolling
(pingdotgg#13555), focus returns after saving a citation note (pingdotgg#13450)
- Nested task states stay out of parent bullets (pingdotgg#11477). Compact
provider instance badges are back (pingdotgg#13700), and the OpenAI logo is
updated (pingdotgg#13611)
- Client runtime: sync status no longer flickers (pingdotgg#13551), slow servers
finish loading the thread list once instead of twice (pingdotgg#13683), hidden
terminal drawers release thread history (pingdotgg#13686)
- Mobile fixes: Android control sizing, project icons, Home row
performance, and running threads open at the latest message
- The worktree setup label fix (pingdotgg#13590). It applies to UI that
`FEATURES.worktreeSelection` gates.

## Unsupported in Moatless / needs implementation
- **Cursor, OpenCode and Antigravity usage history** (pingdotgg#10409), and the
Cursor keychain usage toggle `cursorKeychainUsageEnabled` (pingdotgg#13714). They
read usage in `apps/server/src/usage/*UsageReader.ts`, and the toggle is
written through `server.updateSettings`, which the backend does not
dispatch. The toggle stays hidden under
`FEATURES.providerConfiguration`.
- **Android foldable controls in the Device panel** (pingdotgg#13534, pingdotgg#13574).
They sit under `FEATURES.deviceHub`, which is off.
- **Desktop and server only:** `RunningThreadKeepAlive` (pingdotgg#13554), the
desktop compile cache (pingdotgg#13501), the Linux .deb auto-updater (pingdotgg#13575),
OTLP environment variables (pingdotgg#13492, pingdotgg#13641), the heap snapshot on
SIGUSR2 (pingdotgg#13694), event-loop stall tracing (pingdotgg#13697), and the `t3 trace`
CLI (pingdotgg#13698). None of these applies to the Moatless web deployment.

## Backend behavior to consider reproducing in Moatless
Added to `docs/fork/gaps.md`, under *Runtime fixes upstream made to its
own server*:
- Settling a thread closes its idle shells: `terminal/Manager.ts`
(pingdotgg#13673)
- Usage reads Cursor, OpenCode and Antigravity history (pingdotgg#10409)
- Newer Codex models get the runtime instructions again:
`CodexDriver.ts`, `RuntimeInstructions.ts` (pingdotgg#13547)
- Background work no longer scales with every thread or project:
  - no per-minute git reruns (pingdotgg#13689)
- no thread-list rebuilds for per-thread settlement or PR checks
(pingdotgg#13691, pingdotgg#13720, pingdotgg#13693)
  - PR sync reads only threads with a linked PR (pingdotgg#13704)
  - the SQLite WAL shrinks after large writes (pingdotgg#13684)
  - shutdown no longer rewrites every stopped session row (pingdotgg#13688)
- Also: the OpenCode v2 serve ready line (pingdotgg#13651), and retrying failed
SQLite statement preparations (pingdotgg#10584)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
Moatless task:
https://moatless.soaplabstest.com/tasks/0af5f959-42c9-4219-b6ff-2f43e9e72a5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant