From 4eed393db5d19651e9d041574e21fb0d85c435b7 Mon Sep 17 00:00:00 2001 From: Timebomb2018 <18868801967@163.com> Date: Wed, 8 Apr 2026 11:11:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(app):=201.=20List=20operation=20node=20sub-?= =?UTF-8?q?variable=20comparison=EF=BC=9B=202.=20Non-Dashscope=20Omni=20mo?= =?UTF-8?q?del=20processing=EF=BC=9B=203.Handling=20the=20issue=20of=20dis?= =?UTF-8?q?appearing=20iterative=20nodes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/core/models/base.py | 2 +- api/app/core/workflow/adapters/dify/converter.py | 6 +++--- api/app/core/workflow/nodes/list_operator/node.py | 9 ++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/api/app/core/models/base.py b/api/app/core/models/base.py index f5df7ed8..eff6292f 100644 --- a/api/app/core/models/base.py +++ b/api/app/core/models/base.py @@ -112,7 +112,7 @@ class RedBearModelFactory: params["stream_usage"] = True # 深度思考模式 is_streaming = bool(config.extra_params.get("streaming")) - if is_streaming: + if is_streaming and not config.is_omni: if provider == ModelProvider.VOLCANO: # 火山引擎深度思考仅流式调用支持,非流式时不传 thinking 参数 thinking_config: Dict[str, Any] = { diff --git a/api/app/core/workflow/adapters/dify/converter.py b/api/app/core/workflow/adapters/dify/converter.py index 41459d8d..2cdfacbc 100644 --- a/api/app/core/workflow/adapters/dify/converter.py +++ b/api/app/core/workflow/adapters/dify/converter.py @@ -483,11 +483,11 @@ class DifyConverter(BaseConverter): node_data = node["data"] result = IterationNodeConfig.model_construct( input=self._process_list_variable_literal(node_data["iterator_selector"]), - parallel=node_data["is_parallel"], - parallel_count=node_data["parallel_nums"], + parallel=node_data.get("is_parallel", False), + parallel_count=node_data.get("parallel_nums", 4), output=self._process_list_variable_literal(node_data["output_selector"]), output_type=self.variable_type_map(node_data.get("output_type")), - flatten=node_data["flatten_output"], + flatten=node_data.get("flatten_output", False), ).model_dump() self.config_validate(node["id"], node["data"]["title"], IterationNodeConfig, result) diff --git a/api/app/core/workflow/nodes/list_operator/node.py b/api/app/core/workflow/nodes/list_operator/node.py index 245ad665..edc15ed1 100644 --- a/api/app/core/workflow/nodes/list_operator/node.py +++ b/api/app/core/workflow/nodes/list_operator/node.py @@ -11,7 +11,7 @@ from app.core.workflow.variable.base_variable import VariableType logger = logging.getLogger(__name__) # File object fields that hold string values -_FILE_STRING_KEYS = {"name", "extension", "mime_type", "url", "transfer_method", "origin_file_type", "file_id"} +_FILE_STRING_KEYS = {"type", "name", "url", "extension", "mime_type", "transfer_method", "origin_file_type", "file_id"} _FILE_NUMBER_KEYS = {"size"} @@ -100,10 +100,17 @@ class ListOperatorNode(BaseNode): else: left = item # primitive array: compare element directly + # Determine if this field should be compared as a string + is_string_field = isinstance(item, dict) and cond.key in _FILE_STRING_KEYS + # Numeric operators if op == ComparisonOperator.EQ: + if is_string_field: + return str(left) == str(value) return self._safe_num(left) == self._safe_num(value) if op == ComparisonOperator.NE: + if is_string_field: + return str(left) != str(value) return self._safe_num(left) != self._safe_num(value) if op == ComparisonOperator.LT: return self._safe_num(left) < self._safe_num(value)