improvement(executor): subflows, hitl handling cleanup #4604
improvement(executor): subflows, hitl handling cleanup #4604icecrasher321 wants to merge 13 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryHigh Risk Overview DAG wiring gains explicit subflow control edges: start→end bypass routes for skip-at-start / early exit, Runtime behavior shifts parallel batching to sentinel-driven Pause / resume / run-from-block: snapshots persist deactivated edges and activated join nodes; resumed edges mark targets as activated before readiness checks; pause completion is recorded before returning paused. Restored parallel batches re-register cloned nested subflows in the parent map. Large test coverage accompanies these paths. Reviewed by Cursor Bugbot for commit 70d0777. Configure here. |
Greptile SummaryThis PR refactors the workflow executor's parallel batching and nested subflow handling: batch expansion is deferred from
Confidence Score: 3/5The core batch-timing refactor and metadata unification look structurally sound, but the empty-parallel path loses its execution log because sentinel-end is never activated after emitEmptySubflowEvents was removed without a parallel-equivalent of the loop skippedAtStart sentinel-end bypass. The redesign correctly fixes the concurrent batch-reset race by deferring expansion to sentinel-start. However, the empty-parallel case silently drops the block log: prepareCurrentBatch returns early, sentinel-start emits sentinelStart true with no selectedRoute, the PARALLEL_EXIT bypass edge is classified as a control edge and deactivated, and sentinel-end never fires. Empty loops handle this correctly with skippedAtStart plus selectedRoute LOOP_EXIT; the parallel path has no equivalent. apps/sim/executor/orchestrators/parallel.ts (prepareCurrentBatch empty-scope early return and sentinel-start return value for empty parallels), apps/sim/executor/execution/state.ts (getScopedBlockOutput linear scan) Important Files Changed
Sequence DiagramsequenceDiagram
participant E as ExecutionEngine
participant SStart as ParallelSentinelStart
participant PO as ParallelOrchestrator
participant Branch as BranchNodes
participant SEnd as ParallelSentinelEnd
participant NO as NodeOrchestrator
E->>SStart: execute
SStart->>PO: initializeParallelScope
SStart->>PO: prepareCurrentBatch
PO->>PO: expandParallel, registerClonedSubflows, resetBatchExecutionState
SStart-->>E: sentinelStart true
E->>Branch: execute branches
Branch-->>E: output per branch
E->>NO: handleNodeCompletion
NO->>PO: handleParallelBranchCompletion
E->>SEnd: all branch edges satisfied
SEnd->>PO: aggregateParallelResults
alt more batches
PO->>PO: advanceToNextBatch
SEnd-->>E: PARALLEL_CONTINUE
E->>SStart: re-execute
else done
PO->>PO: emitSubflowSuccessEvents
SEnd-->>E: PARALLEL_EXIT
end
Reviews (7): Last reviewed commit: "address comments" | Re-trigger Greptile |
|
bugbot run |
|
@greptile |
|
@greptile |
|
bugbot run |
|
@greptile |
|
@greptile |
|
bugbot run |
|
bugbot run |
|
@greptile |
|
bugbot run |
|
bugbot run |
|
@greptile |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 70d0777. Configure here.
Summary
Refactors parallel batching onto explicit DAG control flow while hardening nested subflow execution, pause/resume, run-from-block, and output resolution edge cases.
Type of Change
Testing
Tested manually
Checklist