From 80e88651e6fc98b7b8c0adc5abbd79cec374bac9 Mon Sep 17 00:00:00 2001 From: "Robbin (Dev Agent)" Date: Wed, 25 Feb 2026 05:52:07 +0530 Subject: [PATCH] fix: add cycle detection to prevent infinite recursion in graphExecutor (closes #79) --- src/main/graphExecutor.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/graphExecutor.ts b/src/main/graphExecutor.ts index b2fcd19..8a3deb5 100644 --- a/src/main/graphExecutor.ts +++ b/src/main/graphExecutor.ts @@ -104,6 +104,7 @@ async function executeBrowserGraph({ visited: Set, iterations: { count: number } ): Promise => { + if (visited.has(nodeId)) return; if (iterations.count++ > 10000) throw new Error("Maximum iteration limit reached"); visited.add(nodeId); const node = nodes.find((n: Node) => n.id === nodeId);