GeezerVison is showing github.com — fix(web): a branch switch no longer waits behind the previous PR lookup by Yuruzuu · Pull Request #28576 · pingdotgg/t3code
Conversation
Problem
Picking a branch shortly after the previous switch can stall for seconds: the label stays dimmed and the picker is disabled. In a real client the trigger took up to 6.09 s to come back during rapid switching.
Change
Opening the picker sends a local status refresh (#22807) through vcsCommandScheduler, the serial per-checkout queue that vcs.switchRef also uses. On the server that refresh takes the remote write lock, so it waits for any running PR lookup. The checkout then waits behind the refresh, so an unrelated PR lookup holds up a local git checkout.
Now the picker uses refreshLocalStatusForPicker, the same RPC outside that queue. The refresh only reads status, so it has no reason to hold up a checkout. Other refreshStatus callers keep the queue.
Web and desktop share this picker. Mobile doesn't send this refresh when opening its picker, so it doesn't change. No contract or server changes.
Scope and approval
This qualifies for the small, focused bug-fix exception in CONTRIBUTING.md: 13 non-test lines that stop a read from blocking a checkout, with no feature, default or contract change.
Verification
Real web client (Chrome, 1280×800, fresh state, scratch clone of this repo with origin on GitHub). 8 picks per build, logged by a page observer. Captured on this commit before a rebase over one unrelated upstream commit.
| Trigger enabled again, median / max |
Before |
After |
| Rapid switching |
1.91 s / 6.09 s |
0.105 s / 0.116 s |
| Waiting for each switch to settle |
0.115 s / 5.42 s |
0.122 s / 0.141 s |
The median time between picks in the rapid runs was 2.54 s before and 0.91 s after, because the tool could pick again as soon as the trigger came back. Combined with #28575, the settled maximum goes from 4.95 s to 0.713 s.
Before recording (main), after recording (this branch), raw measurements.
vp test run src/state/vcs.test.ts (packages/client-runtime): 11/11. The new test checks that a checkout completes while the picker's refresh is still held, and it fails if the serial queue is restored. tsc --noEmit passes on apps/web and packages/client-runtime. check:changed: lint, knip and tests pass. Format flags only an untracked local file, and vp run typecheck can't start in my checkout because of a stale tsc shim.
These runs don't prove the server half of the cause directly; the unit test covers the queue. Flagging one thing seen nearby: in one exploratory run on this build, a PR badge appeared and vanished about 15 ms later, a few times on one switch. It didn't reproduce in the corrected runs. I reproduced a likely cause in a unit test on unmodified main: a local-only refresh that captured "no remote status" before waiting on the lock clears the PR the earlier read just published. So it looks pre-existing and isn't fixed here, though I haven't shown that this is what the run hit.
Not checked: native desktop, relay and tunnel.
Made with Claude Opus 5.5 via Claude Code in T3 Code. Real-client captures and measurements by GPT-6.1 Terra via Codex in T3 Code.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 1, 2026
Approvability
Verdict: Approved at 530fb04
Macroscope's review found this PR approvable — The branch picker’s local status refresh now runs outside the shared command queue so it does not delay a subsequent branch switch. Mutating commands remain serialized, and existing server-side status locking is unchanged.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between b50d8a1 and 530fb04.
Files selected for processing: 3
-
apps/web/src/components/BranchToolbarBranchSelector.tsx
packages/client-runtime/src/state/vcs.test.ts
packages/client-runtime/src/state/vcs.ts
Limit details: You’ve used all 10 included reviews currently available.
Walkthrough
-
The branch picker now uses a local-only status refresh command without the serial scheduler or concurrency limit. A test verifies that a ref checkout can complete while the refresh is pending.
Changes: Branch picker refresh
| Layer / File(s) |
Summary |
Picker refresh and checkout packages/client-runtime/src/state/vcs.ts, apps/web/src/components/BranchToolbarBranchSelector.tsx, packages/client-runtime/src/state/vcs.test.ts |
The selector uses refreshLocalStatusForPicker when the picker first opens. The command invalidates cached refs when it settles and does not use the serial scheduler or concurrency limit. A test verifies that checkout succeeds while the refresh RPC is pending. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Possibly related issues
- Issue 27696 reports delays from shared command queue contention. This change addresses the picker refresh wait described in the issue, but does not change the reported polling volume.
Suggested reviewers: utkarshusername, juliusmarminge, t3dotgg
Merge Risk: Minimal · up to 530fb
-
The picker refresh no longer blocks checkout through the client queue. No merge-blocking risk was found.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly and concisely describes the main fix: branch switching no longer waits behind a previous PR lookup. |
| Description check |
 |
The description covers the problem, change, scope and approval rationale, verification results, limitations, and evidence. It is complete and directly related to the changes. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
Note This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
maria-rcks
commented
Nov 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Note Written by gpt-6.1-sol on behalf of Maria
Verified in a real dev environment
Verified unchanged head 530fb0431e0b0cba0ff969ae15caa7f03791c01a against github/main at 8760d063e9 on a disposable Linux VM. Used separate installs, one background dev server at a time, Playwright from the repo, and /usr/bin/google-chrome at 1280×800. Created the project and thread through the app, using a real clone with GitHub origin and real Codex gpt-6.1-sol turns. No mocks or seeded/demo data.
- Reproduced the queue delay on main. Across 15 actual alternating branch checkouts per build, pick-to-enabled-trigger median/max was 2253/2731 ms on main, 849/1110 ms on this head. Excluded each run's initial already-current selection. Checked the actual git branch after every pick.
- Observed real WebSocket traffic: main sent all 15 checkout requests after the picker refresh completed. This head sent all 14 fully paired checkout requests while that refresh was still pending; 10 completed before it. The last refresh response fell outside the capture. Example: a PR-head refresh took 1207 ms, while checkout was sent 231 ms into it and completed 131 ms later.
- Search plus keyboard selection switched to
verification-c. Searching another branch and pressing Escape preserved that checkout. A subsequent real Codex tool call returned verification-c, matching the client and git.
vp run check:changed HEAD^ passed through blacksmith-check: format, lint, both knip passes, seven affected package typechecks, 11 vcs tests, and the changed component's React compiler check. All 32 reported PR checks were successful.
Representative repeat captures as animated recordings, with elapsed time visible:



Not verified
Native Electron, iOS/Android, macOS/Windows, relay/tunnel connections, and other providers were not exercised. This verifies the local web checkout queue change, not the separate PR-badge race described in the PR body. Briefly stale branch metadata also appeared on main during rapid picks.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @Yuruzuu for finding and measuring this! #33263 (a22068f) removes the remote-write lock from local-only status refreshes, so opening the picker no longer waits for the PR lookup and holds checkout behind it. The picker still serializes the local status read itself; if bypassing that remaining wait matters, please open a smaller PR focused on that case.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @juliusmarminge, and thanks for #33263. I opened the smaller follow-up as #33877. It only takes the picker's local-only refresh out of the serial VCS queue, so a checkout picked right after opening the picker doesn't wait for that read. The remaining wait is one local status read. That's about 0.1 s on branches near main and about 0.4 s on a branch far ahead of main, and keyboard picks (open, type, Enter) land inside it. No server or contract changes. The queue test from here carries over.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|