Skip to content

Commit 2f55231

Browse files
committed
fix(executor): check all node outputs for done signal, not just last layer
1 parent 10f79bb commit 2f55231

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/certamen/application/execution/async_executor.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,13 @@ async def _execute_layer(
379379

380380
def _is_iteration_done(
381381
self,
382-
tasks: list[tuple[str, Any]],
383382
node_outputs: dict[str, dict[str, Any]],
384383
execution_id: str,
385384
iteration: int,
386385
max_iterations: int,
387386
) -> bool:
388-
current_iteration_nodes = {node_id for node_id, _ in tasks}
389-
for node_id in current_iteration_nodes:
390-
if node_outputs.get(node_id, {}).get("done") is True:
387+
for node_id, outputs in node_outputs.items():
388+
if outputs.get("done") is True:
391389
logger.info(
392390
"[%s] Termination signal from node %s",
393391
execution_id[:8],
@@ -480,7 +478,7 @@ async def _execute_workflow(
480478
iteration = 0
481479
while True:
482480
iteration += 1
483-
last_tasks = await self._run_iteration(
481+
await self._run_iteration(
484482
iteration,
485483
execution_layers,
486484
node_instances,
@@ -496,7 +494,6 @@ async def _execute_workflow(
496494
break
497495

498496
if self._is_iteration_done(
499-
last_tasks,
500497
node_outputs,
501498
execution_id,
502499
iteration,

0 commit comments

Comments
 (0)