Skip to content

Agents and tool calls · 6 of 6

The deploy that killed every run

Step 1 · The pattern

Long runs, steady progress

Each agent run takes four steps (model calls and tool calls), several seconds in this picture and often much longer in reality. Runs start, work through their steps and finish. (All numbers are illustrative.)

  • a run
  • finished

In short

The deploy that killed every run: how it works and how it breaks

A web request lasts a fraction of a second, so restarting servers during a deploy barely matters. Agent runs are different: a research task or a code change can run for many minutes or hours, through dozens of model calls and tool calls. Restart the runners mid-run and every run in flight dies; without saved state, each starts again from zero, repeating the work, the tokens and the wait, and the user's progress bar resets. With frequent deploys, the longest tasks may never finish at all. Anthropic describes building its research agents to resume from where they were when errors occurred, rather than restarting, and using rainbow deployments that shift traffic gradually so runs on the old version can finish. Checkpoint each run's state after every step to durable storage, resume from the last checkpoint after any restart, and drain old runners slowly instead of killing them.

What this simulation simplifies

  • Every run takes four equal steps; real runs vary widely.
  • Gradual rollout and checkpointing are shown as one switch.

How this comes up in interviews

"How would you run agent tasks that take up to an hour, on a service you deploy several times a day?"

Then they ask

  1. What happens to runs during a deploy?
  2. Where does progress live?
  3. What about steps that already acted?

A strong answer covers

  • Runs outlive deploys; restarts kill runs in flight.
  • Checkpoint state after every step to durable storage; resume after restarts.
  • Gradual (rainbow) rollouts: old runners drain before stopping.
  • Idempotency keys for side-effecting steps re-run on resume.
  • Durable execution engines (e.g. Temporal) provide this.

Points to cover, not a script. Say them in your own words and tie them to a system you have worked on.

On one page: the track cheat sheet.

Last reviewed: Engineering write-up

Diagrams are our own simulations: the timings, rates and counts in them are illustrative, not measurements. Captions are original wording.