Repository navigation
Conversation
…show Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Passive status rows skip unused Changes totals while full subscriptions and direct reads retain them. The change is limited to read-only status computation and in-memory caching, with no persistent-data or product-default changes. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Problem
Every visible sidebar thread row subscribes to local git status, and each one paid for the branch-wide Changes totals. Only the thread header shows those totals. On startup, reconnect, or when scrolling the sidebar, a burst of rows ran 16 git processes each instead of 3. That competed for CPU and disk with whatever the user was waiting on, including the turn-end checkpoint capture. On Windows, in a 31K-file repo, 30 concurrent sidebar loads took 3.0 s.
Change
The
includeRemote: falsesubscribers (SidebarThreadRow.tsxtwice,ThreadStatusIndicators.tsxonce) read only the branch name and PR fields.branchChangesis already optional in the contract, so they can go without it.GitManager.localStatustakes{ includeBranchChanges?: boolean }, defaulting totrue. Reads with and without totals use separate cache entries, so a light result is never served to a caller that shows totals. Invalidation clears both.VcsStatusBroadcastercounts, per cwd, who needs totals: full subscribers plus in-flightgetStatusandrefreshStatuscalls. Status reads compute totals only while that count is above zero.Callers that don't pass the option, including turn start, MCP, and auto-pull, keep the full read. Web, desktop, and mobile need no changes, and no contract changes. #29155, #26036, and #18842 also edit
VcsStatusBroadcaster.ts; I expect only small text conflicts.Scope and approval
This qualifies for the small, focused fix exception in CONTRIBUTING.md. It stops computing data that the requesting client never displays, without changing what any client shows, product defaults, or contracts.
Verification
vp test runon theVcsStatusBroadcaster,GitManager,GitWorkflowServiceandRunFinalizationServicetests: 153 passed, 2 skipped. The same 2 skip onmain.main, because the sidebar snapshot carriesbranchChanges.Measured with the real
GitVcsDriverandVcsProcesson Windows 11: a 31,771-file clone, N concurrent local statuses on one cwd plus one checkpoint capture, alternating before and after, medians.In the last row the capture overlaps only the first git commands of each status, which run either way. The harness calls the git driver directly. It leaves out GitManager's 1 s result cache and the hosting-provider lookup. It also uses one cwd, whereas real sidebar rows usually point at different worktrees.
Not checked: a run in a real client.
Made with Claude Opus 5.5 via Claude Code in T3 Code.
🤖 Generated with Claude Code