Repository navigation
fix(vscode): keep session switching responsive with expanded edit diffs - #14808
Merged
Merged
Conversation
Reserve the cached height of a restored open tool card and defer its body mount, so Pierre and Shiki diff work no longer runs inside the Agent Manager session switch. Fall back to the eager path when the cached measurement is missing or stale.
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (incremental pass)
Fix these issues in Kilo Cloud Previous Review Summaries (2 snapshots, latest commit d756c2b)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit d756c2b)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit 0e470ef)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (8 files)
Reviewed by deepseek-v4.1-flash · Input: 49.5K · Output: 5.2K · Cached: 264.2K Review guidance: REVIEW.md from base branch |
Store a short checksum of the patch instead of the full string, so the cache cannot pin large diff payloads for the webview lifetime. Addresses review feedback.
marius-kilocode
enabled auto-merge
October 5, 2026 13:53
WebReflection
approved these changes
Oct 5, 2026
This was referenced Oct 6, 2026
This was referenced Oct 7, 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
Switching between Agent Manager worktrees was slower when a visible tool card had an expanded inline edit diff. Profiling warm switches over the same transcript showed the switch span growing from about 56 ms with collapsed edit cards to about 92 ms with two expanded cards. Every expanded capture also produced a 50 to 57 ms main-thread long task. The cost was Pierre diff reconstruction and Shiki tokenization running synchronously inside the selection task.
Why This Change Was Made
A remembered-open deferred card previously disabled deferred body mounting on remount, so the virtualizer would not see a collapsed frame and loop. That kept the row stable but forced the whole diff render into the switch.
This change records the measured body size. On remount, it reserves that height immediately while the existing deferred queue builds the body after the first frame, and it suppresses the open animation for the reserved frame. A stale measurement (different width or font) or a changed diff, status, or approval state falls back to the eager path.
User Impact
The target transcript appears within a frame and expanded diffs fill in shortly after, instead of blocking the switch. Collapsed cards are unchanged.
Evidence
Matched captures in an isolated VS Code instance, three runs applied to the same 326-row transcript, one expanded 94-line diff, and identical scroll positions.
switch.paint)switch.shell)edit.body)switch.settled)For reference, the first controlled comparison that isolated the cause, mean of three runs:
Validation:
Limitations:
switch.paintis a semantic animation-frame mark, not compositor presentation. Three instrumented runs per variant support this matched workload rather than a general latency guarantee.