Refactoring

Refactoring

🧵 Essays

Durable execution for AI agents

How to make agents work for hours reliably on their own

Luca Rossi's avatar
Luca Rossi
Nov 25, 2026
∙ Paid
Upgrade to paid to play voiceover

One nice way to measure whether AI is getting better is how long it can work unsupervised: the length of a task, in hours of human work, that a model can finish on its own.

About this, METR introduced the so-called “50% time horizon”, that is, how long a software task can be (in human time) before a model only succeeds half the time. This was around 50 minutes for Claude 3.7 Sonnet, and it has been doubling every 7 months since 2019.

On 20 Nov, though, they published an update. On their combined task suite the window is now doubling every 3.6 months (2x as fast as before!) and the current frontier, GPT-6 Astra and Claude Opus 5.5, sits at around 40 hours of human-equivalent work.

So, we went from about 1 hour, to a week, in just a year and a half!

In my work I never ventured into runs that last multiple days, but I start having long tasks anyway:

  • Video production work, like designing and rendering animations for the podcast, often takes several hours for a single pass.

  • Frontier has pipelines to turn illustrations into 3D rendering, and the longest lasted about ~20 hours, producing over a GB of files.

So, the longer the work the more, of course, we need to account for state, failures, recovery, and everything that makes such work reliable.

I have been on a journey for a while now to harden this part of my process. Last month I moved my coding agents to the cloud, and these days I am looking into durable execution to instrument my workflows properly.

To do this, I got in touch with Tony Holdstock-Brown and the team at Inngest, which I am looping in today to explore what all of this should look like at the state of the art.

Here is the agenda:

  • 🧱 Every step should be recoverable — the runtime, the agent, and the database

  • 🧠 State lives outside the sandbox — a central orchestrator plus throwaway VMs

  • ⏰ Agents need a way to wake up — time, events, sub-agents, and flow control

  • 🔍 The run record is your eval dataset — scoring agents from production traces

  • ⚖️ When a cron job is enough — when a retry is not, plus a checklist

  • 📚 Resources

Let’s dive in!


Disclaimer: I am thankful to Inngest for partnering on this and sharing what they see from teams running these workflows in production. I am a fan of what they build and you should check it out!

Learn more about Inngest

As always I will only write my unbiased opinion on the practices and tools covered, Inngest included.


🧱 Every step should be recoverable

As we already covered in How to Run Good Agents in Production, when something breaks, you want the workflow to continue from the last successful step, not start over.

A cloud agent run is basically a loop of unreliable calls (model, tool, sub-agent…). Durable execution treats each call as its own step, saves the result as a checkpoint, and if a later step fails, or the process dies, a new execution retries and continues from there without rerunning the completed steps.

Recoverable doesn’t mean you should retry everything, though. Tony told me how Featured ships about 2,500 articles a month with a team of seven. Each article is a single run of 60 to 150 durable steps, and most of their functions don’t retry, on purpose. The failure they fear most is a bad article auto-published on a customer’s site, so a bad run just marks itself failed and stops, rather than shipping or silently retrying its way into a mess.

They also keep the most important checks out of the workflow, with a uniqueness constraint in Postgres against things that shouldn’t happen twice.

So, I would split this into three parts:

  • Runtime — owns transient failures: timeouts, rate limits, 5xx errors, VMs that die, etc. Retry the step, with backoff.

  • Agents — own semantic failures: a tool that returned something unexpected, a test that fails. These go back to the model as information.

  • Database — owns invariants: anything that must never happen twice (sending, charging, publishing) gets a uniqueness constraint or an idempotency key.


🧠 State lives outside the sandbox

So, where does the run actually live?

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2026 Refactoring ETS · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for writing, podcasting, and media founders.