Skip to content

Commit 194b6ca

Browse files
waleedlatif1claude
andcommitted
fix(executor): clean up cloned loop scopes in deleteParallelScopeAndClones
When a parallel contains a nested loop, cloned loop scopes (__obranch-N) created by expandParallel were not being deleted, causing stale scopes to persist across outer loop iterations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 617a58a commit 194b6ca

File tree

1 file changed

+9
-0
lines changed
  • apps/sim/executor/orchestrators

1 file changed

+9
-0
lines changed

apps/sim/executor/orchestrators/loop.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,15 @@ export class LoopOrchestrator {
408408
this.deleteParallelScopeAndClones(nodeId, ctx)
409409
} else if (this.dag.loopConfigs.has(nodeId)) {
410410
ctx.loopExecutions?.delete(nodeId)
411+
// Also delete cloned loop scopes (__obranch-N) created by expandParallel
412+
if (ctx.loopExecutions) {
413+
const clonePrefix = `${nodeId}__obranch-`
414+
for (const key of ctx.loopExecutions.keys()) {
415+
if (key.startsWith(clonePrefix)) {
416+
ctx.loopExecutions.delete(key)
417+
}
418+
}
419+
}
411420
this.resetNestedParallelScopes(nodeId, ctx)
412421
}
413422
}

0 commit comments

Comments
 (0)