Field guide · 33 sources

Field guide: Durable execution

How to run agents that work for hours or days: sleeping and waking, restarts, retries and idempotency, code-owned versus prompt-owned loops, steering, sandboxes, identity and audit, and what incidents teach.

Bottom line

Build a long-running agent as a series of short runs driven by a durable record of events, not as one process that must stay alive (R084-f1) (R084-f2). Let deterministic code own state, scheduling, locks, ordering and completion gates (R263-f2) (R044-f5), and meter money and time outside the model (R094-f3). Make every outside action safe to repeat, because a durable runtime will retry and cannot make a retry safe on its own (R035-f1) (R035-f2). Treat worktrees, shared runtimes and in-process hosts as organisation, not isolation, and keep credentials outside the agent (R263-f5) (R146-f1) (R146-f4) (R084-f4).

The sources make this case mostly through vendor guidance, project documentation and practitioners' accounts of their own builds, with little controlled measurement; the controlled study the guide leans on is a memory study on synthetic single-change services (R084-f6) (R094-f7) (R184-f10). Anthropic's guide describes an always-on agent as one that sleeps most of the time and wakes for short runs that receive an event, do the task and save what happened (R084-f1), but it gives no measured results, failure rates or named deployment (R084-f6). One practitioner account is one engineer's rewrite of his own 27,500-line harness, built from 11 to 21 November, after it failed on agent-owned state, self-grading, piled-up patches, hung processes, retry budgets and deadlocks (R263-f1). He moved state into deterministic code (R263-f2) and reports 137 verified commits in the first 24 hours on his own three repositories, while warning that many were diagnostic and that commit count is not the metric he trusts (R263-f3). A martinfowler.com article draws the line between runtime and harness duties, using a toy Python domain and the author's own runs (R035-f1).

The Microsoft outage in the set is not an agent failure (R232-f1). It is Microsoft's preliminary account, as relayed by The Register, of a months-old gateway defect that load testing on weaker hardware missed, which spread through the fleet within two hours, with more than 80% of servers unresponsive at the lowest point (R232-f1) (R232-f2). Applying it to agents is an analogy, and the headroom lesson drawn from it is a practitioner's inference, and Microsoft says the service had sufficient headroom (R232-f4).

Several of the durable-execution sources are LinkedIn or practitioner posts by the builders themselves, and one is a short video. "How this was made" lists how each was weighted, and claims from thin sources carry less weight below.

Decide first

QuestionIf yesIf noEvidence
Will the agent wait on people, timers or outside events for longer than a process lives?Drive it from a durable event inbox with timers that become inbox events, as Anthropic's guide describesNo source in this set addresses this case(R084-f1) (R084-f2)
Will the workflow retry remote calls or outlive a crash or deploy?Use a durable runtime or checkpointed steps, and keep the idempotency key constant in the harnessNo source in this set addresses this case(R035-f1) (R035-f2) (R094-f2)
Must the order of steps, approvals or file choices be guaranteed?Put them in workflow code, as Codemod's v2 and Hoyt's rewrite doA prose route of instruction files is one practitioner's suggestion, untested(R173-f1) (R263-f2) (R044-f5) (R015-f3) (R015-f4)
Will many threads run at once against the same repository or inbox?Give each its own worktree or branch and a lease, and allow one worker per inboxOne worker and one checkout is enough(R263-f2) (R084-f3) (R273-f1) (R212-f3)
Can people message the agent while it runs?Choose explicitly between queueing, folding in and interrupting, since Anthropic's guide lists all three and recommends noneNo source in this set addresses this case(R084-f6) (R212-f2)
Will several users share one agent runtime?Use no ambient tools, explicit allowlists, per-session user tokens and ownership checks on resume, as the Copilot SDK guide requires for its shared serversPer-session state is enough(R146-f2) (R146-f4)
Does the agent call tools as a person, across many servers?Keep credentials outside the agent, as Anthropic's guide describes, and check what each credential allows. Gateways such as LangSmith's beta offer per-call identity and policy, with no published evaluationGive the agent its own narrowly scoped credential(R084-f4) (R074-f2) (R168-f1) (R168-f2) (R168-f4)

Do

  1. Model the always-on agent as short runs off a durable inbox. Anthropic's guide names five primitives around an unchanged agent loop: a durable event inbox with a fast-acknowledging handler, timers in their own store that a polling scheduler turns into inbox events, memory as files on durable storage, permissions and an outbox (R084-f2). It is vendor guidance with no deployment data or reference implementation (R084-f2). LangChain reports that more than 70% of runs of its managed proactive agents start from schedules rather than a prompt, a vendor-reported figure (R123-f3). Vercel's board shows what is missing without this layer: posting does not wake an idle agent, and wake-ups need your own runtime (R177-f3).

  2. Make the inbox, not the worker, the source of truth. The guide recommends that a new worker pick up the same event if one dies mid-run, that only one worker be active per inbox, starting with one inbox per user, that pending events be batched, and that events be deduplicated on source identifiers (R084-f3). These are recommendations the guide does not test (R084-f3). Rebuilding from the log can cost time on some platforms: in the Fowler article's toy runs, Cloudflare took about 0.1 s in memory and about 2 s rebuilt from the log, while Temporal took 14 ms in memory and under 0.1 s rebuilt from the log (R035-f4).

  3. Put idempotency in the harness, not the runtime. The Fowler article says a durable runtime handles a dead process, a failed remote call, repeated work on retry and concurrency, but cannot make a retry safe (R035-f1). Under at-least-once semantics the harness must keep the idempotency key, the PO number in its example, constant across attempts (R035-f2). Vendor documentation describes effects that repeat or outlive a call: the Copilot SDK says a retried storeMemory call can deliver the same memory twice (R146-f4), and Google's ADK v2.10.0 documentation says a client timeout stops polling while the backend request still runs and is billed with its output lost (R206-f4). The multi-agent guide covers the other harness duties the article lists (R035-f3).

  4. Bound retries and say which errors are retryable. An unofficial super-agent prototype adapted from DeepSeek's internal code, which its README calls research code that is not identical to the internal version (R021-f5), is designed to retry transient failures such as HTTP 408, 429 and 5xx three times with growing backoff, then hold a failed Ticket until a person's message, a later report or a retry ends the hold (R021-f4). ADK polls deferred calls with exponential backoff and raises after 5 consecutive failed reads (R206-f2). The MCP specification says clients acting for a user should attempt step-up authorization, with retry limits, when a server returns an insufficient-scope error (R062-f4). Relate returns structured errors with a retryable field (R055-f2). Hoyt's first harness burned retry budgets on network blips (R263-f1).

  5. Let deterministic code own state, scheduling and locks. Hoyt's rewrite uses SQLite leases and fences, one Git worktree per worker, detached process-group watchdogs, pre-landing health checks, targeted rollback and a tiered human admission policy, in place of agent-owned state and a fifty-step plan (R263-f2). That design is his own and not independently reviewed (R263-f2). Codemod's v2, a vendor alpha, moves the decisions about which projects to skip, which files each rule group sees and when to pause for approval into TypeScript, replacing 953 lines of launcher and YAML in one internal example (R173-f1) (R173-f5). The FairyClaw authors argue for keeping ordering, safety rules and completion gates in runtime code because prose instructions are suggestions the runtime cannot enforce, from one case study and no ablation (R044-f5).

  6. Checkpoint completed steps and keep results outside the sandbox. Iusztin's CodeClimb checkpoints completed steps in Inngest so a crash does not repeat paid work, stores commits and scores outside the sandbox, and pauses for up to three days without running sandboxes when credits run out (R094-f2). That is his description of his own setup, with no crash-injection test (R094-f2). Codemod's workflow reuses saved results from matching completed steps on resume, demonstrated on one example with no crash test (R173-f2). The kernel-search authors keep memory in an append-only SQLite archive outside the model that agents re-read after restarts (R129-f6).

  7. Write a recovery path that checks the world before repeating an action. In the DeepSeek prototype's design, on restart, running Assignments end with the status host restarted, and new ones start with a recovery note telling the Executor to check its directory, git history and GitHub before repeating any outside action, while sessions and pending messages survive (R021-f3). The Fowler article makes re-checking before commit after a wait a harness duty (R035-f3). In one memory study with synthetic single-change services, 94 of 97 runs that read back the stored state corrected an out-of-date write (R184-f5) (R184-f10).

  8. Version the rules a waiting run depends on, and decide what a deploy does to it. In the Fowler article's toy runs, a rule change during a wait left Temporal continuing under the old rule silently while Cloudflare failed and left the order as a draft (R035-f5). The DeepSeek prototype records the policy version in each Ticket's immutable Mandate (R021-f1), and kagent resolves an Agent to an immutable prepared revision (R093-f2). kagent's README does not say how long-running conversations receive urgent prompt fixes (R093-f4), and no source in this set describes a tested answer.

  9. Give each concurrent thread its own workspace and lease, but do not call that isolation. Nijholt runs 15 sessions on a normal day and up to 40 at peak, each one thread with its own Git worktree, by his own account of a tool he co-founded (R273-f1) (R273-f4). Vercel's board treats claims as time-limited leases, for example five minutes (R177-f1). Git Ontology Agent runs independent requests on their own branch and merges them back by claim type (R212-f3). Hoyt warns that worktrees isolate filesystems but not credentials, privileges or network (R263-f5). In one kernel-search run, evaluation rate rather than agent count limited scale (R129-f3).

  10. Treat steering a running agent as a design decision. Anthropic's guide lists three options for mid-run events, push to the next run, fold into the current run, or interrupt and restart, and recommends none (R084-f6). A deferred tool call ends the run and saves the session, and the answer arrives as an inbox event that starts a new run (R084-f4). Git Ontology Agent classifies each mid-task message as supplement, correction, independent, cancel or progress, asks the user when confidence is below 0.8 (R212-f2), and reopens only the claims that depend on a changed one (R212-f3). That README gives no accuracy figures for the classification (R212-f2). In the DeepSeek-derived prototype, a person's message reaching a Ticket through its own Subscription arrives with no new evaluation and can resume an ended Ticket under the same Mandate (R021-f1).

  11. Start proactive work in an observe mode. The DeepSeek prototype starts unrequested work in observe mode, which records what it would accept and accepts nothing, and its docs advise switching to auto only after reviewing the recorded decisions (R021-f2). The Claude Code team rolls out its commit gate in off, observe and enforce modes (R182-f2). The prototype's docs give no usage data for the modes (R021-f2).

  12. Use an independent checker and an outside test, not the agent's own grade. Hoyt's first harness let agents grade their own diffs generously (R263-f1), and his rewrite adds an independent fresh-context reviewer (R263-f2). Nijholt has three models review each diff with no model reviewing its own code (R273-f2). AWS built its emulator by having agents correct each test against real AWS first and then build until the emulator passed it (R080-f1). Google's Elephant-Goldfish plugin stops a review if the host cannot create fresh-context subagents (R017-f2). The verification guide covers checking in depth.

  13. Meter money and time outside the model. CodeClimb's metering proxy enforces 2.50 dollars per experiment, 15 dollars per night, 6 rounds and a 6-hour deadline by returning HTTP 402, reserves budget for the final test, and is backed by plateau detection, timeouts and a kill switch (R094-f3). Uber reports moving polling to a background agent because notification turns were about a third of spend in its 20 highest-spend sessions (R246-f7).

  14. Know where credentials and tool policy live. Anthropic's guide describes credentials injected by a proxy outside the agent environment (R084-f4). LangSmith's Tool Gateway, a public beta, puts MCP tools behind one URL with per-agent tool kits and per-call identity as the user or as the agent (R168-f1), and describes deny and approval policies, with deny policies available by contacting the team (R168-f2). Its only evidence is one unnamed retailer, with no latency, adoption or incident data (R168-f4). Omnigraph's release notes tell operators who serve MCP to check what each agent credential allows before upgrading, because agents now gain every tool their policy allows even if no flag was set (R074-f2). The security guide covers credential scoping.

  15. Decide what the record of a run keeps, and under whose identity. LangSmith traces each tool call with tool, server, user, outcome and duration but not payloads, and its organisation-wide audit log is Enterprise-only (R168-f3). Git Ontology Agent records every answer as a commit with its source commit, so a past reply can be replayed with git show, shown in scripted demo output only (R212-f4). Microsoft says agents from eleven named platforms get an Entra Agent ID, with rollout completing in December (R169-f1). OntoBricks shows how identity can drift: its tools are said to run as the end user, but one MCP connection shares a service-principal identity for all users (R256-f3). The two record designs fit together: Git Ontology Agent keeps the agent's own answers in its repository (R212-f4), LangSmith keeps tool-call metadata without payloads (R168-f3), and Cursor's incident shows the risk of stored traces that hold credentials (R195-f1).

  16. Test liveness, not just correctness. Hoyt's new engine hit a scheduler and planner deadlock around hour 20, which he then covered with a 3,456-state liveness test (R263-f3). His first harness had idle workers deadlock on duplicate readiness checks and hung child processes holding locks (R263-f1).

Avoid

Where the evidence disagrees

DisagreementSide ASide BWhat reconciles itWhat would settle it
Can instructions carry the workflow, or must code?A test-first skill made agents write a failing test before a fix in 32 of 32 runs against 0 of 32 without it, in the author's own test (R273-f3). A practitioner reel recommends routing the workflow through markdown instruction files (R015-f3)Hoyt's harness failed on agent-owned state and he moved state into deterministic code (R263-f1) (R263-f2). FairyClaw's authors argue prose instructions cannot be enforced by the runtime (R044-f5)They measure different things. The skill test is one behaviour inside a task (R273-f3), while Hoyt's failures were state, locks, processes and scheduling across hours (R263-f1). The reel gives no measurement (R015-f4)The same long task run with state and gates held in prompts against held in code, with injected crashes, repeated
Can long runs go unattended?Nijholt says tasks now run from an hour to more than a day unattended (R273-f1). Hoyt's update reports zero interventions for more than four hours (R263-f4)CodeClimb ran its first night unattended but missed its targets, and its coder repeated a failed decision, so the author says it needs reviewer feedback (R094-f1) (R094-f4). Hoyt says 24 to 48 hours is too early to prove better software over weeks (R263-f5)The sides answer different questions: Side A reports runs that continue without a person, and Side B reports unattended output that was not yet good enough or not yet proven (R094-f4) (R263-f5). Both long-run accounts use independent reviewers (R273-f2) (R263-f2), but no source tests whether that matters, and all three are their builders' own accountsThe same workload run for weeks with and without an independent reviewer, with an incident log

Almost every result here is a builder's or vendor's account of its own system (R084-f6) (R094-f7) (R263-f3) (R273-f4) (R173-f1) (R080-f1) (R168-f4) (R169-f4). The design statements come from project documentation with no usage or failure data (R021-f3) (R146-f2) (R212-f5) (R093-f4).

Numbers

ClaimResultValueConditionsWhere in source
(R084-f5)Cost per solved task, Opus 5.5 vs Opus 578% lower (about 40% on typical workloads)Anthropic's own figure for its own models on one unnamed benchmark; no sample size, task set or methodIntroduction
(R123-f3)Managed proactive agent runs started by scheduleMore than 70%LangChain's Managed Deep Agents, vendor-reportedProactive agents
(R035-f4)Wake-up latencyTemporal 14 ms in memory, under 0.1 s from log; Cloudflare about 0.1 s in memory, about 2 s from logAuthor's own runs on a toy Python domainFootnote 4
(R094-f3)CodeClimb first-night cost10.44 dollars for 5 experimentsAuthor's own run, one night, one project; limits 2.50 dollars per experiment, 15 per night, 6 rounds, 6 hoursPost 1, point 3
(R094-f6)Monthly infrastructure and sandbox cost, Inngest vs LangSmith140 vs 79 (1 user, 20 night runs), 460 vs 1,100 (50 users), 5,200 vs 12,000 dollars (1,000 users)Author's list-price estimates, not bills; excludes model tokens; largest LangSmith case needs an Enterprise quotePost 2, point 4
(R263-f1)First harness size27,500 lines, about 855 commits, 99 filesBuilt 11 to 21 November; author's own buildAll the ways I built it wrong
(R263-f3)Rewrite, first 24 hours137 verified commits; 40 to 57% passing first time; deadlock near hour 20, covered by a 3,456-state liveness testAuthor's own three repositories; many commits diagnosticStarting over from scratch
(R263-f4)Rewrite, next 24 hours109 autonomous commits; zero interventions for more than four hours; four optimisations revertedAuthor's own update; no external verificationUpdate, November 24
(R273-f1)Parallel sessions15 normal, 40 peakAuthor's self-report on a tool he co-foundedTasks that run for a day
(R273-f3)Failing test written first, with vs without skill32 of 32 vs 0 of 32; minimal agent 58 to 76% fewer tokens than MindRoom's standard agentAuthor's own earlier tests; token figure from over 4,000 short terminal runsTasks that run for a day; native harnesses section
(R273-f4)Monthly model usage50,000 to 100,000 dollarsAuthor's statement; not paid by himWhat the numbers do and don't show
(R173-f1)Lines replaced in the Solid 2 migration assistant953Codemod's own internal example; v2 is alphaPut the migration's decisions next to its steps
(R173-f3)Files scanned by store rules1 of 20 (router rules 2)Codemod's demonstration on one open-source projectBefore and after
(R212-f2)Confidence below which the agent asks the user0.8Design setting in the README; no accuracy dataRelation judgment
(R021-f3)Relay retry backoff2 s doubling to one minuteDesigned behaviour in project docs; no failure statisticsFailure and recovery
(R146-f4)storeMemory callback limit60 s, after which the tool call failsVendor documentationmemory.storeMemory
(R206-f2)Deferred-call polling limitRaises after 5 consecutive failed readsADK v2.10.0 documentationHow deferred scheduling works
(R214-f5)Code Mode run limits10 min if waited on; 2 h in backgroundAnthropic docs; experimental feature, off by defaultTelemetry and limits
(R129-f3)Throughput after one harness warm-restart fix3.6x evaluated candidates per hourBefore and after readings inside one live run; authors' ownSec 1, Sec 5.1
(R246-f7)Share of spend on notification turnsAbout a thirdUber's 20 highest-spend sessions; Uber's own figuresThe levers we've used to reduce the cost of a skill
(R080-f2)AWS Emulator coverageMore than 400 API models, more than 200 servicesAWS's own claims; the 30,000-plus commit figure is from a third-party LinkedIn postOutgrowing hand-built test environments
(R080-f3)Alf replication engine rebuildAbout 2 hours with an agent vs about 4 months by handOne internal anecdote, after four nights with an agent that could not check its resultsThe engineer's job
(R232-f2)Gateway servers unresponsive at the lowest pointMore than 80%Microsoft's preliminary figures via The Register; almost 14% of capacity out of service at failoverRegister article, cascade
(R232-f2) (R232-f3) (R232-f4)Outage timelineFailover 01:07 UTC 12 Nov; fix applied 07:20 UTC 13 Nov; about 15 hours of failed attemptsMicrosoft's account via The Register; preliminary reportRegister article, recovery
(R195-f1) (R195-f2)Cursor credential and extension incidentAPI credentials of under 0.01% of customers; traces of under 0.05% of non-Privacy-Mode users; at most 5,000 users over about 11 hoursCursor's own figuresIncident update
(R169-f1)Agents registered in Agent 365Over 50 millionMicrosoft's own figure in an announcementConnect your agent estate
(R168-f4)Gateway customer exampleMore than 50 MCP servers, over a thousand toolsOne unnamed retailer, as stated by LangChainHow should agents use tools

How this was made

Thirty-two sources were consulted.

A Sonnet model extracted the claims, each tied to a location in its source. Opus wrote this guide from those claims and the related claims.

How each source was weighted:

Checking the sources found several of our earlier entries wrong, overstated or unverifiable:

Those entries have been corrected at the source.

Sources in this guide

A field guide synthesizes the Research entries it cites. Each claim id links to the entry it comes from.