From 9930e1f5a0458fde73619e701f2033704d241382 Mon Sep 17 00:00:00 2001 From: GuanMu Date: Wed, 5 Nov 2025 12:08:21 +0000 Subject: [PATCH] fix: update boolean value handling in ConditionItem component - Changed boolean options values from boolean types to string types ('true' and 'false') for consistency. - Updated the default value handling in the Select component to convert boolean values to strings. - Adjusted the onSelect handler to correctly interpret string values as boolean. --- .../components/tool-condition/condition-item.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web/app/components/workflow/nodes/agent/components/tool-condition/condition-item.tsx b/web/app/components/workflow/nodes/agent/components/tool-condition/condition-item.tsx index 656d4ac1e9..da611a1e39 100644 --- a/web/app/components/workflow/nodes/agent/components/tool-condition/condition-item.tsx +++ b/web/app/components/workflow/nodes/agent/components/tool-condition/condition-item.tsx @@ -52,8 +52,8 @@ const ConditionItem = ({ const needsValue = operatorNeedsValue(condition.comparison_operator) const booleanOptions = useMemo(() => ([ - { name: t('common.operation.yes'), value: true }, - { name: t('common.operation.no'), value: false }, + { name: t('common.operation.yes'), value: 'true' }, + { name: t('common.operation.no'), value: 'false' }, ]), [t]) const handleSelectVar = useCallback((valueSelector: ValueSelector, varItem: Var) => { @@ -99,13 +99,17 @@ const ConditionItem = ({ return
{t('workflow.nodes.agent.toolCondition.noValueNeeded')}
if (condition.varType === VarType.boolean) { + const currentBooleanValue = typeof condition.value === 'boolean' + ? String(condition.value) + : undefined + return (