fix: refine agent variable logic

This commit is contained in:
zhsama 2026-01-12 18:01:02 +08:00
parent bb190f9610
commit b25b069917
2 changed files with 2 additions and 3 deletions

View File

@ -67,7 +67,7 @@ const WorkflowVariableBlockComponent = ({
)()
const [localWorkflowNodesMap, setLocalWorkflowNodesMap] = useState<WorkflowNodesMap>(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 <span className="hidden" ref={ref} />
const Item = (

View File

@ -113,7 +113,6 @@ const MixedVariableTextInput = ({
if (!onChange)
return
console.log('handleAgentSelect', value)
const newValue = `{{#${agent.id}.context#}}`
onChange(newValue)