From 744159a079d2448515cecf276a06f5017d9e4322 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 3 Jun 2025 14:54:42 +0800 Subject: [PATCH] fix: agent thought replaced by response text (#20571) --- web/app/components/base/chat/chat/hooks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app/components/base/chat/chat/hooks.ts b/web/app/components/base/chat/chat/hooks.ts index fde4674539..28f297b90e 100644 --- a/web/app/components/base/chat/chat/hooks.ts +++ b/web/app/components/base/chat/chat/hooks.ts @@ -366,8 +366,9 @@ export const useChat = ( if (!newResponseItem) return + const isUseAgentThought = newResponseItem.agent_thoughts?.length > 0 updateChatTreeNode(responseItem.id, { - content: newResponseItem.answer, + content: isUseAgentThought ? '' : newResponseItem.answer, log: [ ...newResponseItem.message, ...(newResponseItem.message[newResponseItem.message.length - 1].role !== 'assistant'