From 05b96027f66ee2e03f7a1b84314baebfadcb2882 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Wed, 11 Mar 2026 17:58:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=9A=E8=AF=9D=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=AE=9E=E6=97=B6=E5=93=8D=E5=BA=94=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=9C=AA=E6=AD=A3=E7=A1=AE=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/adapters/ai-elements-adapter.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/adapters/ai-elements-adapter.ts b/src/lib/adapters/ai-elements-adapter.ts index 717afc4..4cd870e 100644 --- a/src/lib/adapters/ai-elements-adapter.ts +++ b/src/lib/adapters/ai-elements-adapter.ts @@ -674,15 +674,15 @@ export function adaptMessageTurn( : undefined, }) } else { - // For DB historical data, unmatched tools default to "completed" - // since the conversation has already ended. "input-available" (Running) - // only makes sense for live streaming contexts. + // For live streaming, unmatched tools are still running. + // For DB historical data, default to "completed" since the + // conversation has already ended. adaptedContent.push({ type: "tool-call", toolCallId, toolName: block.tool_name, input: block.input_preview, - state: "output-available", + state: isStreaming ? "input-available" : "output-available", }) } }