From 0670dd12b2dd3ba3dcc71d7b77227c6fe31be793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BA=91=E9=BE=99?= <76432572+nankingjing@users.noreply.github.com> Date: Sat, 11 Jul 2026 15:00:30 +0800 Subject: [PATCH] fix(workflow): allow cross-type numeric comparison in selector operator WillAccept The WillAccept method for OperatorEqual/OperatorNotEqual had an overly restrictive type check that rejected int64-vs-float64 comparisons, even though the runtime evaluation (Clause.Resolve) uses alignNumberTypes to handle this case correctly. The condition on line 60 should only enforce strict type equality for booleans, not for numeric types (int64/float64 are handled by the cross-numeric check below). Signed-off-by: nankingjing --- backend/domain/workflow/internal/nodes/selector/operator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/domain/workflow/internal/nodes/selector/operator.go b/backend/domain/workflow/internal/nodes/selector/operator.go index ae0e1bfc26..7be81e93bd 100644 --- a/backend/domain/workflow/internal/nodes/selector/operator.go +++ b/backend/domain/workflow/internal/nodes/selector/operator.go @@ -57,7 +57,7 @@ func (o *Operator) WillAccept(leftT, rightT reflect.Type) error { return fmt.Errorf("operator %v only accepts int64, float64, bool or string, not %v", *o, leftT) } - if leftT.Kind() == reflect.Bool || leftT.Kind() != reflect.String { + if leftT.Kind() == reflect.Bool { if leftT != rightT { return fmt.Errorf("operator %v left operant and right operant must be same type: %v, %v", *o, leftT, rightT) }