From 0ccf8cb23ebcffd097b6fbee86200239f771473e Mon Sep 17 00:00:00 2001 From: Novice <857526207@qq.com> Date: Thu, 5 Jun 2025 14:56:41 +0800 Subject: [PATCH] fix: agent moderation not working (#20673) --- web/app/components/base/chat/chat/hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/components/base/chat/chat/hooks.ts b/web/app/components/base/chat/chat/hooks.ts index 28f297b90e..10fb455d33 100644 --- a/web/app/components/base/chat/chat/hooks.ts +++ b/web/app/components/base/chat/chat/hooks.ts @@ -366,7 +366,7 @@ export const useChat = ( if (!newResponseItem) return - const isUseAgentThought = newResponseItem.agent_thoughts?.length > 0 + const isUseAgentThought = newResponseItem.agent_thoughts?.length > 0 && newResponseItem.agent_thoughts[newResponseItem.agent_thoughts?.length - 1].thought === newResponseItem.answer updateChatTreeNode(responseItem.id, { content: isUseAgentThought ? '' : newResponseItem.answer, log: [