From 685c846b914eac9488e0b09e5e1ceb9d0b36d888 Mon Sep 17 00:00:00 2001 From: weishu Date: Fri, 26 Dec 2025 13:34:54 +0800 Subject: [PATCH] feat: handle thinking blocks as reasoning blocks in chat normalization --- web/src/chat/normalize.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/chat/normalize.ts b/web/src/chat/normalize.ts index f661fc04..16107c1c 100644 --- a/web/src/chat/normalize.ts +++ b/web/src/chat/normalize.ts @@ -116,6 +116,10 @@ function normalizeAssistantOutput( blocks.push({ type: 'text', text: block.text, uuid, parentUUID }) continue } + if (block.type === 'thinking' && typeof block.thinking === 'string') { + blocks.push({ type: 'reasoning', text: block.thinking, uuid, parentUUID }) + continue + } if (block.type === 'tool_use' && typeof block.id === 'string') { const name = asString(block.name) ?? 'Tool' const input = 'input' in block ? (block as Record).input : undefined