From 03774a7bd0c08ac83cf4cac8fb5e027d0192ea89 Mon Sep 17 00:00:00 2001 From: Stream Date: Sat, 31 Jan 2026 21:52:37 +0800 Subject: [PATCH] fix: refix parameter for tool --- api/core/agent/patterns/function_call.py | 5 ++++- api/core/tools/__base/tool.py | 4 ++-- api/core/workflow/nodes/llm/node.py | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/core/agent/patterns/function_call.py b/api/core/agent/patterns/function_call.py index 53c2159807..9c76f5d83d 100644 --- a/api/core/agent/patterns/function_call.py +++ b/api/core/agent/patterns/function_call.py @@ -138,12 +138,15 @@ class FunctionCallStrategy(AgentPattern): tool_response, tool_files, _ = yield from self._handle_tool_call( tool_name, tool_args, tool_call_id, messages, round_log ) + tool_entity = self._find_tool_by_name(tool_name) tool_outputs[tool_name] = tool_response # Track files produced by tools output_files.extend(tool_files) if tool_response == TERMINAL_OUTPUT_MESSAGE: function_call_state = False - final_tool_args = tool_args + final_tool_args = tool_entity.transform_tool_parameters_type( + tool_args + ) yield self._finish_log( round_log, diff --git a/api/core/tools/__base/tool.py b/api/core/tools/__base/tool.py index 24fc11aefc..9c0e8d0963 100644 --- a/api/core/tools/__base/tool.py +++ b/api/core/tools/__base/tool.py @@ -57,7 +57,7 @@ class Tool(ABC): tool_parameters.update(self.runtime.runtime_parameters) # try parse tool parameters into the correct type - tool_parameters = self._transform_tool_parameters_type(tool_parameters) + tool_parameters = self.transform_tool_parameters_type(tool_parameters) result = self._invoke( user_id=user_id, @@ -82,7 +82,7 @@ class Tool(ABC): else: return result - def _transform_tool_parameters_type(self, tool_parameters: dict[str, Any]) -> dict[str, Any]: + def transform_tool_parameters_type(self, tool_parameters: dict[str, Any]) -> dict[str, Any]: """ Transform tool parameters type """ diff --git a/api/core/workflow/nodes/llm/node.py b/api/core/workflow/nodes/llm/node.py index e8799fade5..c4e5ef323b 100644 --- a/api/core/workflow/nodes/llm/node.py +++ b/api/core/workflow/nodes/llm/node.py @@ -1963,7 +1963,6 @@ class LLMNode(Node[LLMNodeData]): # Files are saved as ToolFiles with valid tool_file_id for later reference sandbox_output_files = session.collect_output_files() - if result is None: raise LLMNodeError("SandboxSession exited unexpectedly")