2 Commits

Author SHA1 Message Date
release-bot
e098be6013 fix: also execute all nodes before debug node
All checks were successful
🚀 Lint & Test & Deploy / release (pull_request) Successful in 3m56s
2026-02-12 21:57:33 +01:00
release-bot
ec13850e1c fix: make debug node work with runtime 2026-02-12 21:42:44 +01:00

View File

@@ -125,10 +125,10 @@ export class MemoryRuntimeExecutor implements RuntimeExecutor {
}
}
const nodes = [];
const nodes = new Map<number, RuntimeNode>();
// loop through all the nodes and assign each nodes its depth
const stack = [outputNode];
const stack = [outputNode, ...graphNodes.filter(n => n.type.endsWith('/debug'))];
while (stack.length) {
const node = stack.pop();
if (!node) continue;
@@ -137,18 +137,24 @@ 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) {
node.state.depth = parent.state.depth - 1;
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<string, unknown>) {