From 0f79e07c1232549b1518b1d894a68f023b9dbb7a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 17 Mar 2026 11:32:18 +0800 Subject: [PATCH] bugfix --- dagflow/dagflow.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dagflow/dagflow.py b/dagflow/dagflow.py index 229be18..b44ff7e 100644 --- a/dagflow/dagflow.py +++ b/dagflow/dagflow.py @@ -351,16 +351,19 @@ where backid=${backid}$ continue cond = edge.get('when') if cond and not safe_eval_condition(cond, {'ctx': ctx}): + debug(f'{cond=}, {ctx=},不匹配分支,{edge=}') continue m_on = edge.get('foreach') if m_on: on_array = safe_eval_condition(m_on, ctx) for e in on_array: - nnodes.append((edge['to'], str(e))) + nnodes.append((edge['to'], str(e), edge.copy())) else: - nnodes.append((edge['to'], None)) + nnodes.append((edge['to'], None, edge.copy())) - for node_id, ctx_ext in nnodes: + if len(nnodes) == 0: + debug(f'{ne=}, {edge}, 没有找到下一个节点') + for node_id, ctx_ext, edge in nnodes: node = dsl['nodes'][node_id] if isinstance(ctx_ext, dict) or isinstance(ctx_ext, list): ctx_ext = json.dumps(ctx_ext, ensure_ascii=False) @@ -402,6 +405,8 @@ where backid=${backid}$ continue await sor.C('node_execution', ns) + else: + debug(f'{node=}, {edge=}, {inst=}is_ok_to_create_new_node_exe() 返回了{x}' async def is_ok_to_create_new_node_exe(self, sor, node, edges, inst): join = node.get('join')