Lesson 03.08 · Phase 03 · The Agent Loop
Interrupts and resumption
If the whole run lives in one serialisable state, then pausing for a human, surviving a crash, and resuming tomorrow are the same feature.
Learning objectives
- Keep an agent run's entire state in one JSON-serialisable object, and checkpoint it atomically after every change.
- Pause before side-effecting tools, and resume with a human decision: approve, edit the arguments, or reject with a reason.
- Resume after a crash without repeating tool calls that already ran.
- Resume from a different process, which is what a real approval queue needs.
Your support agent decides to refund ₹2,400 and email the customer. You want a person to look before the money moves. That person might answer in ten seconds, or tomorrow morning. Meanwhile the process that ran the agent might be redeployed, crash, or be one of fifty workers.
Loading the full lesson…