From ec13850e1c0ca5846da614d25887ff492cf8be04 Mon Sep 17 00:00:00 2001 From: release-bot Date: Thu, 12 Feb 2026 21:42:44 +0100 Subject: [PATCH] fix: make debug node work with runtime --- app/src/lib/runtime/runtime-executor.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/lib/runtime/runtime-executor.ts b/app/src/lib/runtime/runtime-executor.ts index 81584dd..279f069 100644 --- a/app/src/lib/runtime/runtime-executor.ts +++ b/app/src/lib/runtime/runtime-executor.ts @@ -125,7 +125,7 @@ export class MemoryRuntimeExecutor implements RuntimeExecutor { } } - const nodes = []; + const nodes = new Map(); // loop through all the nodes and assign each nodes its depth const stack = [outputNode]; @@ -137,18 +137,23 @@ export class MemoryRuntimeExecutor implements RuntimeExecutor { parent.state.depth = node.state.depth + 1; stack.push(parent); } - nodes.push(node); + nodes.set(node.id, node); } for (const node of graphNodes) { if (node.type.endsWith('/debug')) { node.state = node.state || {}; const parent = node.state.parents[0]; - parent.state.debugNode = true; + if (parent) { + parent.state.debugNode = true; + } + nodes.set(node.id, node); } } - return [outputNode, nodes] as const; + const _nodes = [...nodes.values()]; + + return [outputNode, _nodes] as const; } async execute(graph: Graph, settings: Record) {