alexcinovoj.devby TechTide AI
Back to AI notes
Pattern · AI agent testing

Recovering runs from checkpoints

I store completed steps and their results so a run can resume after an interruption. Recovery also needs repeatable steps, bounded retries, and a way for an operator to stop the run. A checkpoint cannot undo an external side effect by itself.

Short answer

How do checkpoints help a run recover?

I store completed steps and their results so a run can resume after an interruption. Recovery also needs repeatable steps, bounded retries, and a way for an operator to stop the run.

Implementation

  • Checkpoint after each completed step, including tool results and accumulated state.
  • Make every step idempotent, so replaying the boundary step twice is safe.
  • Trip a circuit breaker after repeated failure of the same tool rather than retrying indefinitely.
  • Distinguish retryable faults from terminal ones and stop on terminal.
  • Give the operator a kill path that works from outside the agent's own loop.

What can go wrong

  • Message-history checkpoints can omit external side effects.
  • Unlimited retries can spend the budget on a tool that cannot recover.

Checks to try

  • Kill the worker mid-run and confirm resume produces one consistent result.
  • Force a tool to fail repeatedly and confirm the breaker trips.

Questions this pattern answers

How do checkpoints help a run recover?

I store completed steps and their results so a run can resume after an interruption. Recovery also needs repeatable steps, bounded retries, and a way for an operator to stop the run.

What steps does this method use?

Checkpoint after each completed step, including tool results and accumulated state. Make every step idempotent, so replaying the boundary step twice is safe. Trip a circuit breaker after repeated failure of the same tool rather than retrying indefinitely. Distinguish retryable faults from terminal ones and stop on terminal. Give the operator a kill path that works from outside the agent's own loop.

How can I check the result?

Kill the worker mid-run and confirm resume produces one consistent result. Force a tool to fail repeatedly and confirm the breaker trips.

What can go wrong with this approach?

Message-history checkpoints can omit external side effects. Unlimited retries can spend the budget on a tool that cannot recover.

Related projects

Related patterns

I explain this method here. Current service scope, prices, and terms are on TechTide AI.

Systems Decision Audit at TechTide AI