From the LangGraph: inside the agent runtime architecture map
interrupt() matches resumes by call position, not name, inside Core Types
interrupt() takes a per-task counter from the scratchpad and returns resume[idx], so a resumed node must call its interrupts in the same order as the first run; reorder, add or conditionally skip one and it silently receives another prompt's answer. That logic sits in Core Types & Runtime Context, which 18 of 26 elements here depend on, 11 directly with no fallback, including StateGraph and the Functional API.
Impact: A node that reorders, adds or conditionally skips an interrupt() call gets another prompt's resume value silently, with no error to point at the mismatch, and the risk travels through every one of Core Types' 11 dependents.
Recommendation (small effort): Call interrupt() unconditionally and in a fixed order within a node, and add a regression test that resumes a multi-interrupt node out of order to catch positional drift before it reaches State Node Spec, StateGraph or the Functional API.
The trail
- Schema Typing Helpers
- Core Types & Runtime Context
- State Node Spec
- Errors, Warnings & Callbacks
- Functional API (entrypoint/task)
- StateGraph
- Aggregate & Barrier Channels