An agent that runs for days needs a place to stand when it falls

Persist the agent's state with checkpoints it can resume from, and a crash on day three costs minutes, not the whole run. Keep the state only in the context window and a single failure erases days of work.

B

Balagei G Nagarajan

3 MIN READ


A long-running agent resuming from a saved checkpoint after a crash instead of losing days of work
Short transactional agents hold their state in the conversation and finish before anything can go wrong.
— from “An agent that runs for days needs a place to stand when it falls”

Key facts.

  • "Expensively Quadratic" documents how agent context and cost tend to grow quadratically with steps as history and tool outputs accumulate, making long runs fragile and costly. source
  • OpenTelemetry's GenAI semantic conventions give a standard way to trace a long agent run, the basis for capturing the state you would resume from. source

Why is long-running state so hard for agents?

Short transactional agents hold their state in the conversation and finish before anything can go wrong. A multi-day agent cannot. It runs across crashes, restarts, model timeouts and tool outages and if its only memory of progress is the context window, any one of those wipes out everything it has done. The naive approach, keep accumulating in context and hope nothing interrupts, fails twice: it loses the whole run on a single failure and it gets quadratically more expensive and sluggish as the history grows, which is exactly what the Expensively Quadratic analysis describes. The longer and more valuable the run, the more this hurts.

The fix is borrowed from durable systems: checkpoint the agent's meaningful state, the goal, the progress, the key intermediate results, to durable storage, so the agent can resume from the last good point rather than the beginning. That requires deciding what state is worth persisting and capturing it as the run proceeds, which is where structured tracing helps; the OpenTelemetry GenAI conventions give a standard way to record what happened in a form you can rebuild from. Done well, a crash on day three becomes a resume from a checkpoint minutes old instead of a restart from zero and the long-running agent becomes something you can depend on.

A long run timeline with periodic durable checkpoints allowing resume after a crash

What does durable agent state require?

AspectContext-only statePersisted state
On a crashWhole run lostResume from checkpoint
Cost over timeGrows quadraticallyBounded by checkpointing
What is savedEverything, in contextMeaningful state, durably
Long runsA gambleInfrastructure

All-in-context state grows quadratically and a bigger model does not change it, so a checkpoint makes a crash minutes. (source)

Deciding what state is meaningful enough to checkpoint is a judgment about which parts of the agent's progress matter, which the Pattern Intelligence Layer helps make legible. VibeModel surfaces the agent's progress against the pattern that defines the task, so checkpoints capture the state that actually matters for resuming correctly and a long-running agent can fall and stand back up where it left off instead of starting its multi-day work over.

Frequently asked questions

Why not just keep state in context?
Because a single crash loses it all and the Expensively Quadratic effect makes a growing context slower and pricier. Durable checkpoints avoid both.

What state should you persist?
The meaningful progress: the goal, completed steps and key intermediate results, enough to resume correctly, not the entire raw history.

How is this different from short agents?
Short agents finish before failures matter. Multi-day agents must survive crashes and restarts, which only durable, resumable state makes possible.


Share this post

Join the discussion

Have a take, a war story, or a question? Sign in with GitHub to comment and react. Comments are powered by GitHub Discussions, ad-free and yours to moderate.

Continue Reading

Find where your agent breaks, before you build it

Faultmap maps where your agent will fail from the goal and your data, then hands you the first test suite it has to pass.