fix(vscode): stop hidden polling and reuse diff file counts - #13795
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous Review Summaries (2 snapshots, latest commit 5134625)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 5134625)Status: No Issues Found | Recommendation: Merge Files Reviewed (14 files)
Previous review (commit 2fd7123)Status: No Issues Found | Recommendation: Merge Files Reviewed (13 files)
Reviewed by grok-4.6 · Input: 261.6K · Output: 10.8K · Cached: 323.5K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
September 4, 2026 13:37
WebReflection
approved these changes
Sep 4, 2026
1 task
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
Changes/Review still reread every eligible untracked text file on each 2.5-second summary poll, including while the panel was hidden. Standalone Kilo editor tabs also kept separate 5-second stats pollers active when hidden. The badge cache added in #13728 did not cover the review-summary path, and sequential scans above its 10,000-entry capacity could evict and reread the entire working set on every pass.
Fixes #13720.
Why This Change Was Made
Pause diff and standalone-chat stats polling while the owning view is hidden, including initial hidden activation. Preserve the selected diff source and activation options, then refresh when the view becomes visible. An already-running scan can finish, but it cannot restart the hidden polling timer.
Share metadata-keyed line counts and binary classification between review summaries, individual untracked-file metadata, and badges. Keep the existing 16-operation read limit, 10,000-entry cache limit, and 1,000,000-byte line-count cutoff. Once the cache is full, admit one new path per 16 misses instead of allowing a sequential scan to replace every cached entry. Changed resident entries are still updated immediately; totals are not truncated. Failed binary probes are not cached, and metadata is rechecked after probing so a file that grows beyond the cutoff is not fully read.
User Impact
Visible diffs and badges continue to update. Changes made while a view is hidden appear when it is reopened. Diff totals and text, binary, empty-file, oversized-file, and symlink handling are covered by regression tests.
This reduces repeated file work, not all repository activity: Git status and metadata scans remain. Over-capacity working sets still require some reads. New repositories warm more slowly when the shared cache is already full. No new setting or feature removal is involved.
Evidence
Exact Node summary measurements
macOS arm64, Node v25.2.1. Two separate Node bundles used the same
createLocalDiff(...).summary()workload: the baseline source from86c1928c4aand the final patch at5134625384. The paired run was repeated after the binary-probe recovery and metadata revalidation corrections. Each disposable Git repository contained 512 unchanged untracked text files, each 163,840 bytes and 8,192 lines: 83,886,080 bytes (80 MiB) total. Each pass returned 512 files and 4,194,304 added lines in both versions.CPU is Node process user + system CPU time, not wall time or whole-VS-Code CPU utilization. Times below are the recorded values rounded to milliseconds. Full-file reads count
fs.readFilecalls; Git work and binary-probe reads are separate.Exact cache-capacity measurements
Real 8 KiB text files, three consecutive scans, with unchanged totals:
For the 11,000-file case, warm scans perform 9,935 fewer full-file reads (90.32%), reducing full-file bytes read from 90,112,000 to 8,724,480 per scan. These read counts were reverified after the final probe-safety corrections. Switching to a different 11,000-file root with an already-full cache produced 11,000 / 10,312 / 9,668 reads in the patched version, showing the slower but progressive warm-up trade-off.
Functional verification
5134625384. Automated review reported no issues; there are no unresolved review threads. The two independent local review findings were fixed and retested before enabling auto-merge.The screenshot shows an untracked file refreshed to two lines after editing it while review was hidden. It contains only disposable fixture data.