Skip to content

fix(agent-ui): reset streamed text at generation boundaries in agent chat#10664

Open
walcz-de wants to merge 1 commit into
mudler:masterfrom
walcz-de:fix/agentchat-stream-segment-reset
Open

fix(agent-ui): reset streamed text at generation boundaries in agent chat#10664
walcz-de wants to merge 1 commit into
mudler:masterfrom
walcz-de:fix/agentchat-stream-segment-reset

Conversation

@walcz-de

@walcz-de walcz-de commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What

One agent turn runs several internal LLM generations (tool selection, reasoning, final answer) that all emit stream_event deltas over the same per-agent SSE channel. The agent chat page accumulates every content delta into a single live bubble and ignores the done boundary events — so the internal generations' text (e.g. the English tool-selection rationale) merges with, and visually corrupts, the streamed final answer.

Fix

Reset the accumulated content/reasoning when a done stream event arrives: each generation gets a clean live bubble. The authoritative full answer still arrives via the final json_message event exactly as before, so no information is lost.

Related server-side ordering fix: mudler/LocalAGI#483 (SSE broadcast worker pool scrambles delta order).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KYp5FnAfsdGb6yjLmv8Mge

…chat

One agent turn runs several internal LLM generations (tool selection,
reasoning, final answer) that all emit stream_event deltas over the same
per-agent SSE channel. The chat page accumulated every 'content' delta
into a single live bubble and ignored the 'done' boundary events, so the
internal generations' text (e.g. the English tool-selection rationale)
merged with — and visually corrupted — the streamed final answer.

Reset the accumulated content/reasoning on 'done': each generation gets
a clean live bubble, and the authoritative full answer still arrives via
the final json_message event as before.

Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant