perf(agent-manager): optimize worktree diff loading - #13411
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Previous Review Summaries (7 snapshots, latest commit bf07f65)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit bf07f65)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Previous review (commit 7230c71)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Previous review (commit 71211f1)Status: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous review (commit 5fea23b)Status: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Previous review (commit befab09)The review did not run because the selected model is no longer available. Choose another model in Kilo Code review settings: https://app.kilo.ai/code-reviews Previous review (commit befab09)Status: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (15 files)
Fix these issues in Kilo Cloud Previous review (commit ea74bda)Status: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (21 files)
Reviewed by grok-4.6 · Input: 131K · Output: 10.7K · Cached: 215.3K Review guidance: REVIEW.md from base branch |
|
thanks @WebReflection |
iscekic
left a comment
There was a problem hiding this comment.
Approved, ignorable bot remarks below
Updated performance resultsThe latest optimization replaces two separate tracked-file scans, Measured in the same isolated VS Code instance against the same 12-file worktree, with a cold extension process and all file details loaded:
The earlier figures in the PR description used a different seven-file scenario: 942 ms to 480 ms cold, and 144-169 ms to about 46 ms for warm A-B-A switching. The new 12-file measurements are a separate before/after comparison for the additional Git-scan optimization, not a direct replacement for that seven-file baseline. Warm cached panel reopening remains approximately 4 ms. The remaining cold-load cost is primarily the separate per-file Git detail operations; batching those requests is tracked in #13415. Validation: all 4,153 extension unit tests pass, along with lint, both typechecks, Knip, and manual verification of complete diff rendering and warm worktree switching. |
Summary
Agent Manager worktree review switching rebuilt the entire diff surface and repeated Git work for every detail request. This change retains recently rendered review panels and removes redundant work from the extension-host diff path, while preserving the stacked review UX, complete file loading, comments, Markdown rendering, image handling, and live polling.
Performance
Measurements were collected with the VS Code self-test harness against an ephemeral shadow/fixture workspace containing real worktree diffs. The same Agent Manager surface, worktree cards, and completion checks were used for before/after captures where the worktree remained stable.
The original heavy worktree changed while its owning Agent Manager session was active, so later heavy cold captures are not byte-identical. The final cold seven-file capture is therefore the conservative cold comparison. The warm measurement directly verified the retained DOM, no loading state, no spinner, complete diff hosts, and scroll preservation.
Behavior