Interrupt
Interrupt is the exception type raised to pause execution and request external input.
It carries:
value: the payload you want to surfaceinterrupt_id: a unique ID used to resume
interrupt
interrupt(value) is the helper you call from inside a step.
On first encounter, it raises Interrupt. On resume (when a value is provided for the same interrupt ID), it returns that value.
Resume helpers
Helpers for resuming execution include:set_resume_value(interrupt_id, value)set_resume_values({interrupt_id: value, ...})get_pending_resume_values()clear_resume_values()
Result types
RunResult is a convenience dataclass for runners that want to surface:
- Completion vs interruption vs error
- The interrupt payload
- The last checkpoint id (if applicable)