From bc3629370df203cb9fd8e5b38ed73a3f2d2401a7 Mon Sep 17 00:00:00 2001 From: zejiewang <511217265@qq.com> Date: Thu, 22 Jan 2026 14:43:21 +0800 Subject: [PATCH] fix: non-auto variable type params of agent node tool are not correctly parsed (#31128) Co-authored-by: wangzejie Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- api/core/workflow/nodes/agent/agent_node.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/api/core/workflow/nodes/agent/agent_node.py b/api/core/workflow/nodes/agent/agent_node.py index c527c50280..52f02881e8 100644 --- a/api/core/workflow/nodes/agent/agent_node.py +++ b/api/core/workflow/nodes/agent/agent_node.py @@ -248,7 +248,18 @@ class AgentNode(Node[AgentNodeData]): 0, ): value_param = param.get("value", {}) - params[key] = value_param.get("value", "") if value_param is not None else None + if value_param and value_param.get("type", "") == "variable": + variable_selector = value_param.get("value") + if not variable_selector: + raise ValueError("Variable selector is missing for a variable-type parameter.") + + variable = variable_pool.get(variable_selector) + if variable is None: + raise AgentVariableNotFoundError(str(variable_selector)) + + params[key] = variable.value + else: + params[key] = value_param.get("value", "") if value_param is not None else None else: params[key] = None parameters = params