Repository navigation
fix(vscode): render streamed text at frame cadence - #14002
Merged
marius-kilocode merged 2 commits intoSep 10, 2026
Merged
Conversation
The webview throttled streamed text and reasoning parts to a fixed 100ms, so live text stepped visibly instead of tracking the stream, while the host scheduler already emitted deltas on a 16ms focused lane. Throttle at ~one frame while a part is streaming and keep the 100ms cadence once it settles, so completed history stays cheap. Parameterize createThrottledValue with a reactive interval, defaulting to 100ms, so other callers are unchanged.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summary (commit 8d5cae6)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 8d5cae6)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 111.4K · Output: 9.6K · Cached: 70.1K Review guidance: REVIEW.md from base branch |
When a part settles, the throttle interval grows from 16ms to 100ms and the effect recomputed the trailing timeout with the longer interval, delaying the last streamed token by up to ~90ms. Flush the pending value immediately when the interval increases, and add a regression test that transitions one throttle instance from streaming to settled.
marius-kilocode
enabled auto-merge
September 10, 2026 10:39
WebReflection
approved these changes
Sep 10, 2026
marius-kilocode
deleted the
investigate-text-streaming-latency-reduction
branch
September 10, 2026 10:54
This was referenced Sep 11, 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
Streamed assistant text in the VS Code sidebar stepped visibly instead of tracking the stream. The webview throttled text and reasoning parts to a fixed 100 ms (
TEXT_RENDER_THROTTLE_MS), so live text could repaint at most ~10 times per second, while the host scheduler already delivered deltas on a 16 ms focused lane. The TUI renders at roughly frame cadence, so VS Code felt slower for the same model output.Why This Change Was Made
createThrottledValuenow accepts a reactive interval. Text and reasoning parts pass ~one frame (16 ms) while the part is streaming and fall back to the existing 100 ms once it settles. Completed history keeps the slow cadence, so scrolling old messages stays cheap. The default interval is unchanged, so other callers such asshell-rolling-results.tsxare unaffected.This also stays safe with many concurrent agents. The host already paces each lane: focused 16 ms, visible 50 ms, background 150-400 ms with per-agent backoff. Background sessions stream slower than 100 ms, so their render cadence is unchanged. The webview now matches the focused lane instead of overriding it with 100 ms.
User Impact
Streamed text and reasoning appear smoothly as tokens arrive instead of in 100 ms steps. Total response time is unchanged, since it is model-bound. Background Agent Manager sessions are unaffected.
Evidence
Measured in an isolated VS Code instance with a real model and the compiled webview bundle verified to contain the change. Same prompt and viewport, 3 runs each, sampling rendered text per animation frame.
Inter-update render gap:
Before, every gap was >=86 ms (0% under 75 ms). After, about 40% of gaps are <=33 ms. The p90 gap stays near 100 ms because token arrival now sets the ceiling, not the render throttle.
No CPU regression in Chromium metric deltas over the stream: ScriptDuration 0.73-1.00 s before vs 0.87-0.93 s after; RecalcStyleDuration and LayoutDuration within run-to-run noise. Zero webview console errors; final answer rendered correctly with headings, lists, and code blocks.
Validation
bun test --conditions=browser ./src/components/frompackages/kilo-ui: 72 pass, 0 fail (includes 3 new cadence tests).Limitations