You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Long formatted responses jitter while streaming: every tool-call delta re-renders the whole message #2062
While a long response with markdown (headings, lists, tables, code blocks) streams in, the whole message visibly jitters and reflows until the stream completes. The longer the response, the worse it gets.
Each streamed chunk of a partial tool call (e.g. attempt_completion's result) triggers a full update of the message: the accumulated arguments are re-parsed and the complete text is sent to the webview again. Nothing limits how often this happens. With providers that stream small chunks, this means dozens of full re-renders per second, and partial markdown (half a table, an unclosed code fence) changes the layout on almost every update.
Context (who is affected and when)
Environment: Zoo Code 3.88.0, VS Code on macOS, provider OpenAI Compatible (streaming tool calls).
Measured: a ~600-word answer with a table and a code block arrived as 331 tool-call deltas in 10.5 s (peaks of 40/s). Each delta caused a full update of the completion_result message.
Relevant code path: Task stream loop, case "tool_call_partial" → NativeToolCallParser.processStreamingChunk() appends the delta and re-parses the whole accumulated JSON with parseJSON() → presentAssistantMessage() → AttemptCompletionTool.handlePartial() → say("completion_result", , partial=true). The same happens with plain text chunks.
Workaround confirmed on our side: coalescing the deltas before sending them to Zoo (at most one update every ~150 ms, cut at line boundaries) reduced the same response to 39 updates, and the jitter mostly disappeared.
Suggested fix: throttle partial message updates (e.g. requestAnimationFrame or ~100–150 ms) in the extension or the webview, and ideally render only up to the last complete line while streaming.
Reproduction steps
Configure a provider that streams responses in small chunks (e.g. OpenAI Compatible).
Ask for a long, formatted answer, e.g. "Explain REST vs GraphQL in ~600 words with headings, lists, a comparison table and a code example."
Watch the response while it streams.
Expected result
The response grows smoothly: already rendered content stays stable and new lines are appended below it.
Actual result
The whole message jitters and reflows continuously while streaming, especially once it contains tables or code blocks. It only becomes stable when the stream finishes.
Activity
PierrunoYT commentedon Oct 20, 2026
Working on this!
perf(task): throttle partial message updates to the webview
perf(task): throttle partial message updates to the webview
[Perf] Throttle partial message updates while streaming (Zoo-Code-Org…