fix(vscode): cache and bound change badge file reads - #13728
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summary (commit 0c72ddd)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 0c72ddd)Status: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 138.2K · Output: 6.8K · Cached: 133.5K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
September 3, 2026 08:29
marius-kilocode
disabled auto-merge
September 3, 2026 09:02
Collaborator
Author
|
@WebReflection thanks, I cleaned that up |
WebReflection
approved these changes
Sep 3, 2026
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What Problem This Solves
Addresses the badge-polling part of #13720. A change to one tracked or untracked file invalidates the aggregate Git statistics cache. Previously, the next scan could read every eligible untracked text file again through an unbounded
Promise.all, even when those files had not changed.Why This Change Was Made
Keep the fix within the existing badge readers:
The shared gate deliberately trades some badge-update latency between projects for bounded filesystem pressure. A slow project can queue ahead of another project, and a filesystem operation that never settles can retain a slot. This change does not add filesystem timeouts or cancellation, and prompt submission does not use this gate.
User Impact
Repeated badge scans no longer reread stable untracked files when a neighboring file changes. The normal branch-comparison totals are preserved. The fallback now uses the same binary, symlink, empty-file, and trailing-newline rules as the normal badge path.
The initial scan still reads eligible files. Workloads with constant changes to every file or more paths than the cache can retain still require reads, but concurrent reads remain bounded. There are no CLI, SSE, or cloud synchronization changes. The separate 7.5.9 prompt-send failure was not reproduced, so this PR does not claim to resolve that part of #13720.
Evidence
Paired local measurement
Measured the actual
GitStatsSnapshot.status()anddiff()implementation under Node 25.2.1 on macOS ARM64, using the same disposable Git repository before and after the patch:node --cpu-prof. CPU time is process user plus system time; event-loop delay was measured withmonitorEventLoopDelay.The warm median elapsed time fell by about 80%. Every measured normal-path scan returned the same totals: 2,049 files, +16,777,217, -1. This is a small local sample, not a cross-platform benchmark or a reproduction of all 55 reported worktrees. The timing improvement is from the Node reproduction, not the webview renderer profile.
Regression and manual checks
The new regression test failed before the fix because changing a tracked file reread both unchanged untracked files. It now passes and also covers same-size changes, replacement/deletion, shared fallback reuse, failed reads, and bounded real filesystem probes.
91 focused tests passed. Extension compile, lint, typecheck, Knip, formatting, and the Kilo change-marker guard passed.
In isolated VS Code, the 2,048-file fixture remained usable during repeated tracked-file churn. Adding an untracked file and editing an already-counted untracked file updated the badges correctly. The cropped screenshot below shows the final live update; it is not performance evidence.