Chat streaming performance

Overview

The chat transcript renders streamed text incrementally while an SSE turn is streaming. Each delta is appended as a single text node instead of rebuilding the whole element from the full accumulated string. This removes the O(n²) re-encode and per-delta DOM teardown/recreate that made long turns burn CPU and memory.

The same treatment applies to the live previews that stream beside the reply: a shell command's output and a delegated subagent's nested answer.

Usage

No user-visible controls — the behavior is automatic. Open a chat and watch a long response stream, run a long build through the shell tool, or delegate to a subagent: the text appears progressively with the same look as before, but the page stays responsive.

Behavior