Hot AI News

Durable execution: How AI agents keep working after you close the app

Durable execution saves an AI agent's progress step by step, so a crash, a restart or a day of waiting does not wipe out the work. How it works, who uses it and what it cannot fix.

Durable execution: How AI agents keep working after you close the app
Photo illustration: Aiholics

Durable execution is a way of running software so that its progress is saved as it goes. If the machine crashes, the program restarts elsewhere and continues from the last saved step instead of starting over. For AI agents, which can run for hours and call many outside tools, it is what lets a job outlive a dropped connection or a closed app.

Why a shopping errand is hard to finish in one sitting

Picture an agent asked to find a cheaper energy deal. It reads your current bill, queries several sites, waits for a price to update, asks you to confirm a switch, and only then sends an email. That can take hours. In the meantime a server may restart, a network call may fail, or the agent may simply need to wait for you.

A simple agent loop keeps all of this in memory. If the process dies, the memory is gone. The agent repeats every model call, which costs money and can return a different answer. Worse, it may repeat an action that already happened.

Meta’s Muse, launched in the UK this month, is a current example of the problem. Our report on the launch notes that longer jobs continue after the app is closed. Meta’s announcement says Muse “comes back when something changes or when it needs approval.” Meta does not describe how it keeps that work alive after a failure.

Advertisements

Saving every step so a crash costs almost nothing

A monitor displays an AI agent workflow with three completed steps, a saved progress preview and a highlighted active step.
Photo illustration: Aiholics

The core idea is a log of what has already been done. Microsoft’s documentation for its Durable Task tools says the runtime “checkpoints every state transition” to durable storage. That includes model responses, tool results and decisions about what to do next. After a failure, execution “resumes automatically on a healthy VM,” and completed model calls are not repeated.

Think of a video game with autosave. You do not replay the whole game after a crash. You reload the last save and carry on. Durable execution autosaves after each model call and each tool call.

Vercel’s guide to durable agents describes the same loop in four moves: run a model call or tool operation, save the result, suspend if the task needs an outside event, and continue using the recorded results when execution resumes.

Two ways to recover: Replay or restart from a snapshot

Systems differ in how they rebuild the agent’s state. The first approach is replay. Temporal, a workflow engine built for ordinary software long before agents, keeps an Event History, which its documentation calls a complete, ordered record of everything that happened in a workflow. After a crash, a new worker fetches that history and runs the workflow code again, feeding it the recorded events. This rebuilds the program’s working state and lets it pick up exactly where it stopped. Recorded results are reused, so finished steps are not run again.

Replay has a price. Temporal’s documentation says a workflow definition must be deterministic, because it is rerun to rebuild state. Anything that talks to the outside world belongs in a separate step, called an Activity. For an AI agent, this is why model calls and tool calls are treated as recorded steps whose results are stored, not recomputed.

The second approach is a snapshot. Cloudflare’s Agents SDK describes this in its documentation on fibers. An agent can save a snapshot of its progress with ctx.stash(data), which writes to SQLite and replaces the previous snapshot. After the host is evicted, Cloudflare says the original code cannot be replayed automatically. Developers write recovery logic in the onFiberRecovered() hook, deciding whether to resume, compensate or leave the record for inspection.

Advertisements

Who offers it today

Several vendors now sell this as agent infrastructure. Microsoft lists support for frameworks including Pydantic AI, LangGraph (in preview), Semantic Kernel and AutoGen on its Durable Task stack, and describes long-running tasks as first-class, from hours to indefinitely. Vercel offers a Workflow SDK, where code marked "use workflow" and "use step" becomes durable. Cloudflare offers runFiber and startFiber, the latter accepting background work, returning quickly and taking an idempotencyKey to deduplicate retries.

These are vendor descriptions of their own products, and they are the main public record of the pattern so far. The pages read for this article do not state who first applied durable execution to agents.

What durability cannot fix

Saving progress does not make an agent correct. Vercel’s guide says plainly that “durability can preserve an incorrect answer, and retries can duplicate external effects without appropriate protection.” If an agent sent an email and crashed before recording it, a retry could send it twice. Vercel adds that recording an intention to send cannot prove whether delivery happened.

The usual defense is an idempotency key, a unique label that lets an outside service recognize a repeated request and ignore it. It only works when the service supports it.

Other limits come from the design. Cloudflare notes that cancellation is cooperative, so a callback should check whether it was cancelled before visible side effects. It also says there are no automatic retries for fibers, and that failed recovery hooks retry with capped backoff for up to 24 hours by default. Vercel notes that for short interactions a conventional agent loop may be enough.

There is also a security question that durability does not touch. Meta says each Muse user gets a dedicated cloud computer, called Muse Secure VM, and that a separate monitor called Sentinel approves what reaches the internet. Those are Meta’s own claims about isolation, which is a different matter from surviving a crash.

Advertisements

What to watch as agents run longer

As agents move from minutes to days, three things are worth following. The first is how vendors handle approvals, since a job that waits for a person is a natural place to suspend and resume. Meta says Muse asks before sending an email or making a purchase.

The second is how well side effects are protected, because payments and messages are where a repeated step hurts most. The third is whether the field settles on shared conventions. For now, Microsoft, Vercel, Cloudflare and Temporal each use their own terms and tools for the same basic promise: save the work, then pick it up again.

Sign Up for the Daily AI Pulse

One email a day. All the stories that matter.

Daniel ReedAI Research, Safety & Ethics Analyst

Daniel Reed currently works as an AI Research, Safety & Ethics Analyst at Aiholics, writing about how changes in artificial intelligence are affecting and will affect scholarship,…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may also like