Interrupt types
Confirmation
Simple yes/no prompt for binary decisions:
boolean
ConfirmationPrompt in Storybook
Try the confirmed, declined, submitting, and error states.
Choice
Single or multiple selection from predefined options:string (single) or string[] (multiple)
ChoicePrompt in Storybook
Compare single-select and multi-select variants.
Text input
Free-form text entry:string
TextInputPrompt in Storybook
See single-line, multiline, and length-constrained inputs.
Form
Complex data entry using JSON Schema:object (matching schema structure)
Review
Review proposed field changes with per-field accept/reject decisions and visual diffs:ReviewResolution with per-field decisions and summary counts.
ReviewPrompt in Storybook
Inspect per-field diffs, accept/reject controls, and many-change views.
Architecture
Frontend integration
TheChatPanel automatically detects and renders interrupts in messages. For manual integration:
Using prompt components directly
Backend integration
Message metadata format
When a workflow requires input, the backend sends a message with interrupt metadata:API endpoints
| Endpoint | Method | Purpose |
|---|---|---|
/interrupts/{id} | GET | Get interrupt details |
/interrupts/{id} | POST | Resolve interrupt |
/interrupts/{id}/cancel | POST | Cancel interrupt |
/playground/sessions/{id}/interrupts | GET | List session interrupts |
State management
The interrupt store uses a state machine with these transitions:- idle — Awaiting user input
- submitting — User response being sent
- resolved — Successfully processed
- error — Submission failed (can retry)
Best practices
- Clear messages — Write actionable prompts (“Do you approve sending this email to 150 recipients?” not “Proceed?”)
- Meaningful labels — Use descriptive button labels (“Yes, send email” not “Yes”)
- Default values — Provide sensible defaults for form fields
- Cancel behavior — Only set
allowCancel: falsefor mandatory interrupts - Error handling — Always handle resolution failures gracefully