Announced 19 Oct 2026 · Sources checked
What Vercel released
Vercel has released durable-harness, an open-source package that keeps a coding agent's session alive when the cloud function running it crashes, times out or loses its connection. The company introduced it in a 19 October 2026 engineering post by Pranay Prakash and Eric Dodds, and the code is on GitHub as vercel-labs/durable-harness under the Apache-2.0 licence.
The package wraps existing agent harnesses rather than replacing them. It supports Pi, OpenCode, Claude Code, Codex and libfx's fx, and Vercel says it adds durability "from the outside, without changing the harness." The npm package was at version 0.0.1-beta.6 on 22 October, and the README warns that it is experimental and that "its API may change between releases."
A harness is the loop around a model: its prompts, its tools and how it manages context. Projects such as Google Research's Harness2 show how much attention that layer is getting. Vercel's package addresses a narrower problem: what happens to a harness when the machine under it disappears.
Why agents lose work in the cloud
Vercel's post starts with a familiar complaint. Developers run coding agents on their own computers, which means the laptop has to stay awake for an agent to keep working. Moving the agent to the cloud fixes that, but most harnesses were built for long-lived local processes that keep the session in memory and read the workspace and history from the same disk.
In the cloud, Vercel says, "a failed turn or network error means lost work." A virtual machine with persistent storage can hold the files, but it does not record which model calls and tool calls finished, and it does not resume an interrupted turn after a crash. Serverless functions add another problem: they have time limits, and an agent task can easily run for minutes or hours.
The issue is getting sharper as agent tools move to always-on and background modes. OpenCode 2.0 added a background server and Anthropic has been changing how Claude Code's cloud sessions start and stream. Vercel's example is an agent that adds a pricing page to an app, opens a pull request and waits for CI. If its function times out during that wait, a normal harness stops and, once restarted, repeats work it had already done.
How the durable log works
durable-harness stores each session in a log. Before a model call or tool call runs, it writes down an intent; when the call finishes, it writes down the outcome. Each turn is also backed by a message on a queue. If the function running the turn dies, the queue hands the turn to a new function, which reads the log and continues from where the first one stopped.
After a crash, the log shows what finished, what was running and what never started. Calls that completed are read back from the log and never run again, so, Vercel says, "you're never billed twice for a finished model call's tokens." The documentation describes two recovery paths: if a function fails with an error, another resumes the turn right away; if it vanishes without a trace, for example by running out of memory, the queue redelivers the turn once its message lease expires.
Harnesses that keep their own session files, such as Claude Code's transcript, Codex's rollout and OpenCode's event store, have every record mirrored into the log so a new function or sandbox can rebuild them. If a browser watching the agent disconnects, the agent keeps running, and reconnecting catches up from the log. The docs note one edge case: a call that finished just before a crash may not be in the log yet, and is then treated as still running.
Tools that may or may not run twice
The hardest part of resuming an agent is deciding what to do with a tool call that was interrupted. Running it again might be harmless or might do damage. durable-harness makes each tool declare a replay rule. A tool marked 'safe', such as a file read, a lookup or a CI status check, simply runs again. A tool marked 'never', such as posting a pull-request comment or issuing a refund, is not repeated; instead the model is told the call may already have happened, so it can check before trying again.
Vercel's documentation gives the example of a support agent whose function dies while it writes a reply after refunding an order. A new function reads the log, reruns only the interrupted model call, and the customer is refunded once. For the built-in tools of Claude Code, Codex and OpenCode, the adapters tell the model they are safe to repeat; other interrupted calls come back to the model as possibly run.
The package also adds documents, typed JSON objects stored in the session's log for state that is not part of the conversation, such as a to-do list or a plan. Each edit a tool makes commits to the log together with the tool's result, so the document and the tool calls stay consistent after a crash. An app can read the same document without its own database and stream changes to a user interface.
Where the log can live
durable-harness is built on the storage interface of Vercel's open-source Workflow SDK, which the company calls a World. A World combines a log, a queue that acts as a backstop and a stream for whoever is watching. On Vercel the package uses Vercel's managed World; in local development it uses files on the developer's machine; on other servers it can use Postgres, and the blog post also lists MongoDB, Redis and Turso.
Moving an agent to Postgres takes two environment variables, one naming the Postgres World and one with the database URL, according to the post. That matters for teams that do not want to run agents on Vercel: the package is Apache-2.0 and can be self-hosted, although some features, like the Agent Runs trace view, are part of Vercel's platform.
Agent Runs shows a trace of every session, including each model and tool call, and a turn that resumed after a crash appears in the same trace. Commands and files chosen by the model never run on the function's own disk. They run either in a virtual workspace kept in the session's log, with a bash-compatible shell that cannot reach the network, or in the session's own Vercel Sandbox, an approach similar to how Perplexity's Space isolates computer-use agents in Firecracker microVMs.
Supported harnesses and setup
The agent harnesses documentation has setup guides for each harness. Pi uses durable-harness/pi-durable, which the README recommends, OpenCode uses durable-harness/opencode, and fx has its own adapter. Vercel's eve and fx frameworks are durable on their own, so they do not need the wrapper.
Claude Code and Codex are a special case. They expect a real shell and filesystem and, Vercel says, are not safe for multi-tenant use, so they run only in the session's own Vercel Sandbox, never in a shared function. Pi and OpenCode can use either the lighter virtual workspace or a sandbox.
The quick start in the README installs the package in a Next.js app, defines an agent that calls a model through Vercel's AI Gateway, serves it from a chat route and wraps the Next.js config. Agents start with no tools; developers add their own, each with a replay rule. The blog says agents can also make a local harness workflow durable, or serve as the base for building a new durable harness.
Limits and open questions
The package is early. Its 0.0.x version and the README's warning mean the API may change, and Vercel has not published latency or overhead figures for writing every step to a log. All of the recovery behaviour described here comes from Vercel's own post and documentation; AI Lookout has not tested it.
The Sandbox requirement for Claude Code and Codex ties those two harnesses to a Vercel product even when the rest of the stack is self-hosted, since the alternative backends cover the log and queue, not the sandbox. Teams that need those harnesses entirely on their own infrastructure would have to check whether that fits.
The replay rules also put responsibility on developers. A tool wrongly marked 'safe' could run twice after a crash, and a 'never' tool relies on the model to check whether the earlier call took effect. Storing full sessions in a log also creates a new place where prompts, outputs and possibly secrets live, a risk the OpenCode console breach made concrete for agent tools. Still, the core idea, recording intent and outcome for each step so a crash costs seconds instead of a whole task, is a practical answer to a problem anyone running agents in the cloud has met.
Common questions
What is durable-harness?
An open-source package from Vercel that wraps coding agent harnesses so their sessions survive crashes, timeouts and dropped connections, by keeping every step in a durable log.
Which agents does durable-harness support?
Pi, OpenCode, Claude Code, Codex and libfx's fx. Claude Code and Codex run only inside a Vercel Sandbox.
Can I use durable-harness without Vercel?
Yes, in part. It is Apache-2.0 and can store sessions in Postgres or local files, but Claude Code and Codex still need a Vercel Sandbox, and the Agent Runs trace view is a Vercel feature.
Sources & further reading
How this story was made
Written by Kristian Kostov with AI assistance and checked against the linked sources. Company performance claims are attributed to the company. Analysis reflects AiLookout’s interpretation; we have not independently tested the products discussed. The cover places the companies’ own logos, taken from public-domain or openly licensed files credited in the caption, on a plain background. It is not a product photograph, a screenshot, or an endorsement.
Our editorial standards





