From 8429877b024d2fd718feb7127a1525aa49a9591a Mon Sep 17 00:00:00 2001 From: jiandanfeng Date: Wed, 22 Jan 2025 13:20:32 +0800 Subject: [PATCH] fix: Agent is configured for ReAct inference mode, an error is reported when viewing the agent log (#12920) Co-authored-by: crazywoola <427733928@qq.com> --- api/core/agent/cot_agent_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/agent/cot_agent_runner.py b/api/core/agent/cot_agent_runner.py index e936acb605..bbe1865daf 100644 --- a/api/core/agent/cot_agent_runner.py +++ b/api/core/agent/cot_agent_runner.py @@ -172,7 +172,7 @@ class CotAgentRunner(BaseAgentRunner, ABC): self.save_agent_thought( agent_thought=agent_thought, - tool_name=scratchpad.action.action_name if scratchpad.action else "", + tool_name=(scratchpad.action.action_name if scratchpad.action and not scratchpad.is_final() else ""), tool_input={scratchpad.action.action_name: scratchpad.action.action_input} if scratchpad.action else {}, tool_invoke_meta={}, thought=scratchpad.thought or "",