fix(chat): render agent turns as chronological segments with scroll-follow#159
Merged
Conversation
…ollow The chat panel rendered every assistant turn as one text bubble (all iteration narrations glued together without separators) with every tool card dumped below it, and auto-scroll only fired on new messages — so a multi-minute agent turn showed nothing but the Thinking spinner and then a present-tense wall of text at the end. - useChat: ChatMessage now carries ordered segments (text | tool) built live from the SSE stream, so narration and tool cards keep their real chronology; streamTick drives scroll-follow - ChatPanel: assistant messages render segment-by-segment; pin-to-bottom scroll-follow that releases when the user scrolls up - ChatMarkdown atom: extracted throttled markdown pipeline — finished segments freeze, only the trailing streaming segment reparses - engine: additive tool_input event (input visible while a tool is still pending) and input on tool_result; conversation-api response shape is unchanged (it projects fields explicitly) - history hydration prefers content_blocks over the legacy tool_calls column, so reloaded conversations regain their tool cards and never show the literal '[tool calls]' placeholder
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.
Problem
During a long agent turn the user sees only the Thinking spinner; when the turn ends, every intermediate narration ("Şimdi 8 makaleyi oluşturuyorum…") lands as one glued, present-tense wall of text. Verified on staging (conversation `8ad2bba3…`):
Changes
Known/accepted: markdown split across a tool call renders as two independent documents (models don't straddle fences across tool calls in practice).
Follow-up PR (2/2) will make intermediate iterations visible in persisted history and harden the graceful-close summary.
Test
🤖 Generated with Claude Code