From b25b0699173c5e31d6ab3dc2300ef086d5c0de7b Mon Sep 17 00:00:00 2001 From: zhsama Date: Mon, 12 Jan 2026 18:01:02 +0800 Subject: [PATCH] fix: refine agent variable logic --- .../plugins/workflow-variable-block/component.tsx | 4 ++-- .../nodes/tool/components/mixed-variable-text-input/index.tsx | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx index 4ba321e92a..1ff0da78ab 100644 --- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx +++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx @@ -67,7 +67,7 @@ const WorkflowVariableBlockComponent = ({ )() const [localWorkflowNodesMap, setLocalWorkflowNodesMap] = useState(workflowNodesMap) const node = localWorkflowNodesMap![variables[isRagVar ? 1 : 0]] - const isAgentVariable = node?.type === BlockEnum.Agent + const isAgentContextVariable = node?.type === BlockEnum.Agent && variables[variablesLength - 1] === 'context' const isException = isExceptionVariable(varName, node?.type) const variableValid = useMemo(() => { @@ -136,7 +136,7 @@ const WorkflowVariableBlockComponent = ({ }) }, [node, reactflow, store]) - if (isAgentVariable) + if (isAgentContextVariable) return const Item = ( diff --git a/web/app/components/workflow/nodes/tool/components/mixed-variable-text-input/index.tsx b/web/app/components/workflow/nodes/tool/components/mixed-variable-text-input/index.tsx index 031802d51d..c9781adb97 100644 --- a/web/app/components/workflow/nodes/tool/components/mixed-variable-text-input/index.tsx +++ b/web/app/components/workflow/nodes/tool/components/mixed-variable-text-input/index.tsx @@ -113,7 +113,6 @@ const MixedVariableTextInput = ({ if (!onChange) return - console.log('handleAgentSelect', value) const newValue = `{{#${agent.id}.context#}}` onChange(newValue)