Skip to content

[BUG] Long formatted responses jitter while streaming: every tool-call delta re-renders the whole message #2062

Closed

Description

@danGO-79

Problem (one or two sentences)

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

  1. Configure a provider that streams responses in small chunks (e.g. OpenAI Compatible).
  2. 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."
  3. 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.

Variations tried (optional)

No response

App Version

v3.88.0

API Provider (optional)

OpenAI Compatible

Model Used (optional)

No response

Zoo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Activity

  1. PierrunoYT commented on Oct 20, 2026

    @PierrunoYT
    Contributor

    Working on this!

  2. added 2 commits that reference this issue on Oct 24, 2026
    a2fcb85
    a1deed9
  3. added a commit that references this issue on Nov 6, 2026
    457bed3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions