A run that survives a failed tool call
Write the loop as a durable function and each model call and tool call is a step. A tool that times out is retried on its own, completed model calls replay from their checkpoints after a crash, and ctx.wait_until holds the run until a person approves the action it is about to take. Use provider idempotency keys when an interrupted attempt must not repeat a call.
- Every model and tool call checkpointed
- Hours of work, or days of waiting, in one run
- Human sign-off before anything irreversible
step model-1 plan: find the order, then refundstep tool-1 search-orders → 1 matchstep model-2 wants issue_refund · $42.00wait approve-2 pending → approved by supportstep refund-2 issue_refund → refunded✓ succeeded · completed model steps replayed from checkpoints
