diff --git a/site/src/pages/AgentsPage/components/ChatConversation/StreamingOutput.stories.tsx b/site/src/pages/AgentsPage/components/ChatConversation/StreamingOutput.stories.tsx index 461c4c7803..ee6984291b 100644 --- a/site/src/pages/AgentsPage/components/ChatConversation/StreamingOutput.stories.tsx +++ b/site/src/pages/AgentsPage/components/ChatConversation/StreamingOutput.stories.tsx @@ -268,13 +268,24 @@ export const ThinkingDuringStreamingWithToolCalls: Story = { tool_call_id: "tc-1", args: { command: "ls -la" }, }, + { + type: "tool-call", + tool_name: "read_file", + tool_call_id: "tc-2", + args: { path: "README.md" }, + }, ]), }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); - // "Thinking" should still be visible during streaming - // when only tool-call blocks have arrived. + // Tool-only stream chunks can otherwise clear the activity indicator before text arrives. const matches = canvas.getAllByText("Thinking"); expect(matches.length).toBeGreaterThanOrEqual(1); + + const thinkingBlock = matches[0].parentElement; + expect(thinkingBlock).toBeInstanceOf(HTMLElement); + expect(getComputedStyle(thinkingBlock as HTMLElement).marginTop).toBe( + "8px", + ); }, }; diff --git a/site/src/pages/AgentsPage/components/ChatConversation/StreamingOutput.tsx b/site/src/pages/AgentsPage/components/ChatConversation/StreamingOutput.tsx index 135b0a6c37..822e7cfab7 100644 --- a/site/src/pages/AgentsPage/components/ChatConversation/StreamingOutput.tsx +++ b/site/src/pages/AgentsPage/components/ChatConversation/StreamingOutput.tsx @@ -92,7 +92,7 @@ export const StreamingOutput: FC<{ -
+
{shouldShowBlocks && (