From 811e43d0d4f8d0ec5c90a8ab81cb787151fd0e4a 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 234651ce96..bf3c045fd6 100644 --- a/api/core/workflow/nodes/agent/agent_node.py +++ b/api/core/workflow/nodes/agent/agent_node.py @@ -235,7 +235,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