AI agents
Long-Horizon Work, Checkpoints, and Resumability
Design agents that can continue multi-hour or multi-day tasks without relying on one context window.
By the end you can
- Define long-running agent execution as an operational contract rather than a capability label
- Contrast Context-only continuity with Checkpointed agent in “A code agent lost two hours of progress after its context was compacted”
- Trace “A stale checkpoint can resume the wrong world” through a concrete execution path
- Produce “Design a resumable task record” with evidence for “The next model call can continue from durable evidence instead of a full transcript”
Context is a working set, not the project record
Long-horizon agents need durable task state, artifact checkpoints, event logs, progress summaries, and restart logic. Context is a temporary working set. It is not the canonical record of the project.
The condition that record is designed against has been counted. Nine years of failure records at Los Alamos National Laboratory cover 22 HPC systems, 4,750 machines and 24,101 processors. They contain roughly 23,000 failures — every one that required a system administrator's attention. Schroeder and Gibson analysed them in 2006 and reported: “We find for example that average failure rates differ wildly across systems, ranging from 20–1000 failures per year, and that time between failures is modeled well by a Weibull distribution with decreasing hazard rate.” Mean repair time ran from under an hour to more than a day. At 20 to 1,000 failures a year, with repair sometimes measured in days, a crash is not the exception a design tolerates. It is the schedule the design is written to.
The horizon being designed for is a measured quantity too. In March 2025 METR proposed the 50%-task-completion time horizon: the time human experts typically take on tasks a model completes with 50% success. METR timed domain experts on RE-Bench, HCAST and 66 novel shorter tasks. The headline example was Claude 3.7 Sonnet, at around 50 minutes. A later version of the paper replaces it with o3, at around 110 minutes. The abstract closes: “Furthermore, frontier AI time horizon has been doubling approximately every seven months since 2019, though the trend may have accelerated in 2024.” That is the unit of uninterrupted work actually on offer. A multi-day task is that unit repeated many times. Everything that has to survive between repetitions has to be written down somewhere else.
A resumable system can reconstruct the next valid action from persisted state after a process crash, model upgrade, user pause, or context reset.
Anything the project cannot afford to lose has to be written somewhere a context reset does not reach.
Example
466 interruptions in 54 days, and the run still finished
A 16K-GPU cluster ran Llama 3 405B pre-training. For 54 days of it, someone counted every time the job stopped. Meta's Llama 3 technical report, published in 2024, records the total: “During a 54-day snapshot period of pre-training, we experienced a total of 466 job interruptions. Of these, 47 were planned interruptions due to automated maintenance operations such as firmware upgrades or operator-initiated operations like configuration or dataset updates.”
The other 419 were unexpected. About 78% of those were attributed to confirmed or suspected hardware issues. GPU issues alone accounted for 58.7%.
The outcome is the part worth studying. The team achieved higher than 90% effective training time. Across all 466 interruptions, significant manual intervention was required only three times. None of that depended on a running process remembering anything. The process stopped 466 times in 54 days. Recovery was carried by automation and saved state, not by anyone — or any context window — remembering what had happened.
- Decision at stake: Whether progress lives inside the running process or in state that outlives it. Over 54 days the process was interrupted 466 times and the run still returned higher than 90% effective training time.
- Hidden assumption: That a larger context window is sufficient for every long-running agent — that the run will last long enough to hold its own record. GPU issues alone ended 58.7% of the unexpected interruptions.
- Primary control question: A stale checkpoint can resume the wrong world. Restarting 419 unplanned times is only safe if each restart re-reads the world rather than trusting the picture it saved.
- Evidence to collect: Significant manual intervention was required only three times. The ratio of restarts to human rescues is the measurable form of "the next model call can continue from durable evidence instead of a full transcript".
Visual
Progress survives a crash in four separate records
Progress that survives a crash lives in four records, governed by a fifth thing that is not a record at all.
The Task ledger holds goals, constraints, decisions, open questions, and current status. The Artifact checkpoint holds versioned files, patches, datasets, or reports produced so far. The Event history holds actions, results, approvals, failures, and budget consumption. The 466-interruption count in the Llama 3 report is exactly this record, kept where the interrupted process could not erase it. The Resume summary is a compact, evidence-linked briefing for the next model call.
The fifth item is the Recovery policy: the rules for verifying state before work continues. Whoever writes the Resume summary should not also own the Recovery policy. The summary asserts what was true when it was written. The policy decides whether that is still true. Each of the five needs its own test.
- 1
Task ledger
Goals, constraints, decisions, open questions, and current status.
- 2
Artifact checkpoint
Versioned files, patches, datasets, or reports produced so far.
- 3
Event history
Actions, results, approvals, failures, and budget consumption.
- 4
Resume summary
A compact, evidence-linked briefing for the next model call.
- 5
Recovery policy
Rules for verifying state before work continues.
Key idea
A stale checkpoint can resume the wrong world
External systems may change while the agent is paused. Resuming from old assumptions without revalidation can overwrite newer work, repeat actions, or violate updated policy.
That failure has a name and a numbered Internet Standard. HTTP has a header for exactly this case: If-Match. The client carries the entity tag of the version it last saw. RFC 9110 says what the header is for: “If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agents might be acting in parallel on the same resource (i.e., to prevent the "lost update" problem).” The comparison is strict. An origin server MUST use the strong comparison function when comparing entity tags for If-Match. And when the check fails: “An origin server that evaluates an If-Match condition MUST NOT perform the requested method if the condition evaluates to false.” The server MAY report that with a 412 (Precondition Failed), the status code for conditions in the request header fields that evaluated to false when tested on the server. Where the operation appears to have already been applied to the selected representation, it MAY answer 2xx (Successful) instead. So a resume path that carries entity tags is testable. Hand it a stale tag and require the 412.
Store versions and leases, then reconcile external state before executing the next side effect. A lease is the same discipline with a clock attached. Google's Chubby lock service gives every session “an associated lease—an interval of time extending into the future during which the master guarantees not to terminate the session unilaterally.” The default lease is 12 seconds, with KeepAlives exchanged every 7. When a client's local lease timeout expires it empties and disables its cache, and its session is said to be “in jeopardy”. It then waits a further grace period, 45 seconds by default, before assuming the session has expired. Burrows records two observed master elections after lease expiry, one taking 6 seconds and one 4. Both landed inside the grace period. That is why the window exists.
Managed workflow engines publish the same kind of number for the run itself. AWS lets a Step Functions Standard workflow run for one year, and caps its execution history at 25,000 events: “If the execution history reaches this quota, the execution will fail.” An Express workflow stops after five minutes. Azure Durable Functions orchestrator functions “automatically checkpoint execution progress when the function calls an await or yield operator, so the process doesn’t lose local state when it recycles or the VM reboots”. The run itself has no fixed ceiling: “The total lifespan of an orchestration instance can be seconds, days, or months, or you can configure the instance to never end.” Resumability is bounded by numbers someone chose and wrote down.
Chubby's picture of the world expires in 12 seconds and the holder is told; a paused agent's expires too, and nothing tells it when.
Example
Signals that make long-running agent execution defensible
Resumability shows up first: the next model call can continue from durable evidence instead of a full transcript. There is a measured reason to prefer a compact Resume summary to replaying everything that was said. A 2025 paper isolated execution by handing models the knowledge and the plan outright, so that nothing but the length of the run was being tested. Even with an error-free history, model turn accuracy at turn 100 falls below its initial value. Putting the model's own errors back in front of it makes that worse. In the authors' words: “More interestingly, as we increase the rate of injected errors into the context, accuracy at turn 100 consistently degrades further.” They call the effect self-conditioning. It is distinct from long-context degradation, scaling model size does not remove it, and thinking mitigates it. A transcript carrying the agent's own earlier mistakes is not a neutral record of the run. It is an input that lowers the accuracy of the next step.
Three further signals need their own tests. Whether artifacts and decisions remain attributable across model or runtime changes is checked separately, on its own record. Then, under repeated or adversarial cases, test whether resume logic detects external state drift before committing new actions — the stale-entity-tag case, expecting a 412 rather than a silent overwrite. And test whether cancellation and retirement can clean up partial work and credentials.
- Signal 1: The next model call can continue from durable evidence instead of a full transcript. Measured against the alternative: with errors injected into the history, accuracy at turn 100 consistently degrades further, and more parameters do not remove the effect.
- Signal 2: Artifacts and decisions remain attributable across model or runtime changes — the Llama 3 report's 47 planned and 419 unexpected interruptions are attributable because the event record outlived every one of them.
- Signal 3: Resume logic detects external state drift before committing new actions. RFC 9110 gives the test its expected result: MUST NOT perform the requested method when If-Match evaluates to false.
- Signal 4: Cancellation and retirement can clean up partial work and credentials, including leases — Chubby's client waits out a 45-second grace period before it concludes the session is gone.
Steps
Design a resumable task record
A workflow that already runs for hours is the right place to design a resumable task record. Test it by restarting from a checkpoint written before the world changed underneath it, and watch what the agent does with the stale picture.
Separate facts from hypotheses: persist verified state, assumptions, and failed approaches distinctly. Replaying a history in which the failed approaches look like findings is the self-conditioning case. Version artifacts: record hashes, branches, resource versions, and ownership. The entity tag of RFC 9110 is the minimal version of this — one opaque string per resource, carried so the next write can be refused.
Create checkpoints: write progress after meaningful state transitions, not only at the end. How often is a computed quantity, not a matter of taste. The optimum compute interval is the square root of 2·δ·M, where δ is the time to write a checkpoint file and M is the system's mean time to interrupt (MTTI). That is Young's first-order estimate, recorded in a 2006 paper by Daly, at Los Alamos, on the optimum checkpoint interval for restart dumps. It opens on the problem it is solving: “This paper examines methods of approximating the optimum checkpoint restart strategy for minimizing application run time on a system exhibiting Poisson single component failures.” Daly then derives a perturbation solution whose first three terms guarantee, in his words, that the relative error in total problem-solution time “never exceeds 0.2% of the exact solution time”. The paper also shows that restart time R makes no contribution to the optimum, though the first-order model treats it as a contributor. So two measurable numbers set the cadence: what a checkpoint costs to write, and how long the system runs between interruptions. How long recovery takes does not enter it.
Build a resume protocol: revalidate permissions, external versions, budgets, and pending actions before the first side effect, in that order. Test interruption: stop the process at several stages and recover without duplicate effects. The Llama 3 run supplies the target — 466 stops and three rescues.
- 1
Separate facts from hypotheses
Persist verified state, assumptions, and failed approaches distinctly.
- 2
Version artifacts
Record hashes, branches, resource versions, and ownership.
- 3
Create checkpoints
Write progress after meaningful state transitions, not only at the end.
- 4
Build a resume protocol
Revalidate permissions, external versions, budgets, and pending actions.
- 5
Test interruption
Stop the process at several stages and recover without duplicate effects.
Without checkpoints, stopping the run is the only intervention
Checkpointing is both a reliability mechanism and a governance mechanism. It creates review points where humans, policies, or new evidence can change the course. A run that checkpoints only at the end offers a person exactly one control, which is to kill it.
At every restart, a reviewer asks the same two questions. Does this checkpoint still describe the world as it is now, or is it resuming into a world that has moved on? That is the question Chubby answers with a 12-second lease and a jeopardy signal, and RFC 9110 with a strong entity-tag comparison and a 412. The second question: does the checkpoint hold enough saved evidence for the next call to continue from, without the whole transcript being fed back in? That transcript is not free. Its injected errors measurably degrade accuracy by turn 100.
Both questions are answerable only against durable records. Neither can be answered by a longer context window.
Without checkpoints there is nowhere for a person to step in short of killing the run.
Key takeaways
- Long-horizon agents need durable task state, artifact checkpoints, event logs, progress summaries, and restart logic. Schroeder and Gibson found average failure rates of 20–1000 per year across 22 HPC systems, 4,750 machines and 24,101 processors, so a crash is the schedule, not the edge case.
- A resumable system can reconstruct the next valid action from persisted state after a process crash, model upgrade, user pause, or context reset. Llama 3 405B pre-training took 466 job interruptions in a 54-day snapshot and still returned higher than 90% effective training time, with only three significant manual interventions.
- The Task ledger carries goals, constraints, decisions, open questions, and current status — and is owned separately from the Recovery policy that decides whether it may still be trusted.
- The Artifact checkpoint carries versioned files, patches, datasets, or reports produced so far, at a cadence Daly derives from two measurable numbers: checkpoint write time δ and mean time to interrupt M, within 0.2% of the exact solution time.
- Store versions and leases, then reconcile external state before executing the next side effect. RFC 9110 makes a failed If-Match a MUST NOT, with a 412 available to report it, and Chubby's 12-second lease plus 45-second grace period puts an expiry clock on the picture the agent is holding.
- Checkpointing is both a reliability mechanism and a governance mechanism. It creates review points where humans, policies, or new evidence can change the course — and it lets the next call resume from durable evidence rather than a transcript whose injected errors measurably degrade accuracy at turn 100.