From 433ea390a632b9dc8f5ec3c66ee03428e2515ca7 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Fri, 13 Nov 2026 00:21:27 +1100 Subject: [PATCH] feat(chat): render the live turn's thinking in the dashboard (#1907) Reasoning frames accumulate into streamingTurn.reasoning and the live row shows them in a collapsible Thinking trace built from the components/ui trace pattern, with a spinning icon and shimmering title while no reasoning has arrived yet. A turn that produces no reasoning renders no trace, and reasoning never leaks into the reply text. --- ui/src/chat/ChatBubble.vue | 12 +++- ui/src/chat/ChatThinking.vue | 47 +++++++++++++++ ui/src/chat/ChatTranscript.vue | 23 +++++++- ui/src/chat/state.ts | 16 ++++- ui/test/chat-thinking.test.ts | 103 +++++++++++++++++++++++++++++++++ 5 files changed, 197 insertions(+), 4 deletions(-) create mode 100644 ui/src/chat/ChatThinking.vue create mode 100644 ui/test/chat-thinking.test.ts diff --git a/ui/src/chat/ChatBubble.vue b/ui/src/chat/ChatBubble.vue index 945fef0c3..7b93846aa 100644 --- a/ui/src/chat/ChatBubble.vue +++ b/ui/src/chat/ChatBubble.vue @@ -7,6 +7,7 @@ import { CodeBlockCopyButton } from "@/components/ui/code-block"; import { Message, MessageContent, MessageFooter } from "@/components/ui/message"; import ChatAttachment from "./ChatAttachment.vue"; import ChatMarkdown from "./ChatMarkdown.vue"; +import ChatThinking from "./ChatThinking.vue"; import ChatToolCall from "./ChatToolCall.vue"; import ChatToolGroup from "./ChatToolGroup.vue"; import type { ChatMedia, ChatToolCall as ToolCall } from "./state"; @@ -27,8 +28,12 @@ const props = withDefaults( assistant?: boolean; /** The turn is still arriving: a tool call with no outcome is running. */ streaming?: boolean; + /** The live turn's thinking so far, rendered as a collapsible trace. */ + reasoning?: string; + /** The live turn is still arriving and has not reasoned yet. */ + thinkingPending?: boolean; }>(), - { tools: () => [], media: () => [], assistant: false, streaming: false }, + { tools: () => [], media: () => [], assistant: false, streaming: false, reasoning: "", thinkingPending: false }, ); // The reply in the order it happened: text up to each call's offset, then the @@ -73,6 +78,11 @@ const segments = computed(() => { />