Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at 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. |
|
No actionable comments were generated in the recent review.
|
| 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
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 3
- Charged: $0.75
- View usage details
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.
|
Note Written by Verified in a real dev environmentVerified unchanged head
Representative repeat captures as animated recordings, with elapsed time visible: Not verifiedNative 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. |



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 thatvcs.switchRefalso 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 localgit 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. OtherrefreshStatuscallers 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
originon GitHub). 8 picks per build, logged by a page observer. Captured on this commit before a rebase over one unrelated upstream commit.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 --noEmitpasses onapps/webandpackages/client-runtime.check:changed: lint, knip and tests pass. Format flags only an untracked local file, andvp run typecheckcan't start in my checkout because of a staletscshim.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