From 10bbe6b5d40bdd371df5d82c3732198ba2dde8f9 Mon Sep 17 00:00:00 2001 From: balibabu Date: Tue, 9 Jun 2026 19:41:22 +0800 Subject: [PATCH] Fix: The variables in the Visual Input File of the agent operator are not displayed. (#15856) ### What problem does this PR solve? Fix: The variables in the Visual Input File of the agent operator are not displayed. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/pages/agent/constant/index.tsx | 1 + .../pages/agent/hooks/use-get-begin-query.tsx | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/web/src/pages/agent/constant/index.tsx b/web/src/pages/agent/constant/index.tsx index fa169a526a..3789e9b9cf 100644 --- a/web/src/pages/agent/constant/index.tsx +++ b/web/src/pages/agent/constant/index.tsx @@ -786,6 +786,7 @@ export const NoDebugOperatorsList = [ Operator.TitleChunker, Operator.Extractor, Operator.Tool, + Operator.Loop, ]; export const NoCopyOperatorsList = [ diff --git a/web/src/pages/agent/hooks/use-get-begin-query.tsx b/web/src/pages/agent/hooks/use-get-begin-query.tsx index 1c6e2aa03c..35fa9ae0c8 100644 --- a/web/src/pages/agent/hooks/use-get-begin-query.tsx +++ b/web/src/pages/agent/hooks/use-get-begin-query.tsx @@ -356,7 +356,7 @@ export function useFilterQueryVariableOptionsByTypes({ nodeIds = [], variablesExceptOperatorOutputs, }: { - types?: JsonSchemaDataType[]; + types?: (JsonSchemaDataType | VariableType)[]; } & BuildQueryVariableOptions) { const nextOptions = useBuildQueryVariableOptions({ nodeIds, @@ -370,15 +370,19 @@ export function useFilterQueryVariableOptionsByTypes({ ...x, options: x.options.filter( (y) => - types?.some((x) => - toLower(x).startsWith('array') - ? toLower(y.type).includes(toLower(x)) - : toLower(y.type) === toLower(x), - ) || + types?.some((x) => { + const lowerX = toLower(x); + const lowerYType = toLower(y.type); + return lowerX.startsWith('array') + ? lowerYType.includes(lowerX) + : lowerYType === lowerX || + (lowerX === toLower(VariableType.File) && + lowerYType === `array<${lowerX}>`); + }) || // agent structured output isAgentStructured( y.value, - y.value.slice(-AgentStructuredOutputField.length), + y.value?.slice(-AgentStructuredOutputField.length), ), ), };