(loopId: string)
| 574 | } |
| 575 | |
| 576 | restoreLoopEdges(loopId: string): void { |
| 577 | const loopConfig = this.dag.loopConfigs.get(loopId) as LoopConfigWithNodes | undefined |
| 578 | if (!loopConfig) { |
| 579 | logger.warn('Loop config not found for edge restoration', { loopId }) |
| 580 | return |
| 581 | } |
| 582 | |
| 583 | const allLoopNodeIds = this.collectAllLoopNodeIds(loopId) |
| 584 | |
| 585 | if (this.edgeManager) { |
| 586 | this.edgeManager.clearDeactivatedEdgesForNodes(allLoopNodeIds) |
| 587 | } |
| 588 | |
| 589 | for (const nodeId of allLoopNodeIds) { |
| 590 | const nodeToRestore = this.dag.nodes.get(nodeId) |
| 591 | if (!nodeToRestore) continue |
| 592 | |
| 593 | for (const potentialSourceId of allLoopNodeIds) { |
| 594 | const potentialSourceNode = this.dag.nodes.get(potentialSourceId) |
| 595 | if (!potentialSourceNode) continue |
| 596 | |
| 597 | for (const [, edge] of potentialSourceNode.outgoingEdges) { |
| 598 | if (edge.target === nodeId) { |
| 599 | if ( |
| 600 | !this.isSubflowStartExitBypassEdge(potentialSourceId, nodeId, edge.sourceHandle) && |
| 601 | (edge.sourceHandle === undefined || !CONTROL_BACK_EDGE_HANDLES.has(edge.sourceHandle)) |
| 602 | ) { |
| 603 | nodeToRestore.incomingEdges.add(potentialSourceId) |
| 604 | } |
| 605 | } |
| 606 | } |
| 607 | } |
| 608 | } |
| 609 | } |
| 610 | |
| 611 | private isSubflowStartExitBypassEdge( |
| 612 | sourceId: string, |
no test coverage detected