fix(executor): stop HITL error edges from firing on successful resume#5152
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview On resume,
Reviewed by Cursor Bugbot for commit 738b42f. Configure here. |
Greptile SummaryThis PR fixes a bug where a
Confidence Score: 4/5Safe to merge — the fix is well-scoped, the new code paths are fully exercised by six new unit/integration tests, and the underlying edge-readiness invariants hold through manual traces. The fix is correct and the test suite is thorough, covering the primary bug, the real-error case, the convergence join scenario, and the dual source+error edge case. The only notable loss is the removal of JSDoc comments that documented non-obvious loop-correctness invariants on No files require special attention beyond the removed JSDoc in Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Engine as ExecutionEngine
participant EM as EdgeManager
participant DAG as DAG
Note over Engine: initializeQueue() — resume from snapshot
loop for each edge in remainingEdges
Engine->>DAG: nodes.get(edge.source)
Engine->>Engine: resolveRemainingEdgeHandle(edge)
alt "sourceHandle === EDGE.ERROR"
Engine->>EM: deactivateResumedEdge(source, target, EDGE.ERROR)
EM->>EM: deactivateEdgeAndDescendants(source, target, handle)
Engine->>EM: hasActivatedEdge(targetNode.id)
Engine->>EM: isNodeReady(targetNode)
alt already activated AND ready (convergence join)
Engine->>Engine: addToQueue(targetNode.id)
end
else sourceHandle is continuation / undefined
Engine->>EM: markNodeWithActivatedEdge(targetNode.id)
Engine->>EM: isNodeReady(targetNode)
opt ready
Engine->>Engine: addToQueue(targetNode.id)
end
end
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Engine as ExecutionEngine
participant EM as EdgeManager
participant DAG as DAG
Note over Engine: initializeQueue() — resume from snapshot
loop for each edge in remainingEdges
Engine->>DAG: nodes.get(edge.source)
Engine->>Engine: resolveRemainingEdgeHandle(edge)
alt "sourceHandle === EDGE.ERROR"
Engine->>EM: deactivateResumedEdge(source, target, EDGE.ERROR)
EM->>EM: deactivateEdgeAndDescendants(source, target, handle)
Engine->>EM: hasActivatedEdge(targetNode.id)
Engine->>EM: isNodeReady(targetNode)
alt already activated AND ready (convergence join)
Engine->>Engine: addToQueue(targetNode.id)
end
else sourceHandle is continuation / undefined
Engine->>EM: markNodeWithActivatedEdge(targetNode.id)
Engine->>EM: isNodeReady(targetNode)
opt ready
Engine->>Engine: addToQueue(targetNode.id)
end
end
end
Reviews (1): Last reviewed commit: "fix(executor): stop HITL error edges fro..." | Re-trigger Greptile |
Summary
A human_in_the_loop pause block wired to an error handle (e.g. an error-notifier) fired on every successful run. On resume, the engine released all edges out of completed pause blocks and force-marked every target as activated, ignoring sourceHandle — so the pause block's
erroredge was treated as fired, and the convergence check later ran the error branch even though nothing errored.Type of Change
Testing
Added executor tests
Checklist