Korva
Tech

AI agents survive crashes by picking up exactly where they stopped

Each call to the model and each tool use is saved, so a rate limit or outage repeats one step instead of wasting the whole run.

AI image
The Peel with Turner Novak · The Hidden Layer Every AI Agent Runs On

Imagine hiring an assistant to plan a trip, and after hours of comparing flights and hotels, the phone line cuts out. Most computer programs would make the assistant start from scratch.

The way many AI agents avoid that is to never treat a big job as one big job. Tony describes Inngest as a small software kit that gives developers what he calls durable execution. It means breaking work into small, saved steps.

It works like a recipe with checkpoints. In step one, the agent might call an AI model, such as Anthropic's, to decide what to do next. The system saves the result. In step two, it might use a tool the model asked for, like looking up a price or checking a database. That result is saved, too. Then it loops, one model call and one tool use at a time, until it reaches the goal.

If something fails, only that step repeats. Online services go down, databases stall, and AI providers hit rate limits that temporarily refuse extra requests. Instead of losing all earlier context, the system retries exactly the failed step, with everything before it still intact.

The alternative, Tony says, is bleak. Either engineers do not build retries at all, so an agent that dies halfway wastes the whole run, or they spend months hand building their own backup system of queues, which are waiting lines for tasks, and events, which are signals that trigger the next task. That homemade machinery is slow to build and stiff to change, which is the opposite of what AI work needs, because prompts, models, and instructions change constantly.

Saved steps make that constant tinkering possible. Because each attempt is preserved, developers can swap a model, rewrite a prompt, and keep going without rebuilding the safety net every time.

Questions people ask

What is a tool call?

A tool call is when the AI model asks regular software to do something it cannot do by talking, such as checking a calendar, charging a card, or searching a database. The model outputs a structured request, the program runs it, and the result goes back into the model for the next decision. Most useful agents repeat that loop many times per task.

Is this only for AI agents?

No. The same idea is used for online orders, shipments, insurance claims, and other processes where one failed payment or inventory check should not force a restart. AI agents use it too: save after each step, and retry only the failure.

Why do these failures happen so often?

Mostly temporary overloads, plus ordinary internet flakiness. A provider may cap how many requests you can send per minute, a database may briefly go offline, or an outside service may time out. For an agent that makes dozens of calls in a row, even a small chance of failure per call makes a crash during the full run likely.