Making every harness durable
- Source
- vercel.com
- Author
- Pranay Prakash
- Date

Context
Vercel's durable- targets a specific failure: coding- harnesses such as Claude Code, Codex, OpenCode and Pi assume a long-lived process that keeps the session in memory, so when one runs in a cloud function that times out or crashes mid-turn, the agent stops until someone restarts it and steps it already finished are repeated. The package, announced in a Vercel engineering post, adds durability from the outside without changing the harness. Before each model call or tool call it writes an intent to a durable log, and when the call finishes it writes the outcome. The turn is also backed by a queue message, so if its function dies, the queue hands the turn to a new function that reads the log and continues where it stopped.
The log decides what happens to interrupted work. Completed model calls are read back instead of re-run, so their are not billed twice. For tools, the developer declares a replay policy: a lookup marked 'safe' simply runs again, while a tool marked 'never', such as a refund or posting a PR comment, is not repeated; the model is told the call may already have happened so it can check first. Harnesses that keep their own session files, such as Claude Code's transcript, have every record mirrored into the log so they can be rebuilt on a new function or . Storage sits behind the Workflow SDK's World interface, so the same agent can use Vercel's backend, local files in development, or self-hosted Postgres, MongoDB, Redis or Turso. Claude Code and Codex always run inside a Vercel Sandbox, because they expect a real shell and filesystem and are not safe for multi-tenant use.
This generalizes durability Vercel had already built into its own fx and eve agents; an earlier libfx announcement described the same resumable-turn idea for fx and said Pi, OpenCode and custom harnesses would follow. The post explains the design with a demo; it does not report measured recovery rates.
- durable-harness records an intent before each model or tool call and the outcome after, with a queue message backstopping the turn so a new function can resume from the log if one dies.
- Completed calls are read back from the log rather than rerun, so a finished model call's tokens are not billed twice after a crash, according to Vercel.
- Each tool declares a replay policy: 'safe' tools like lookups rerun automatically, while 'never' tools like refunds are reported to the model as possibly run so it can check first.
- Storage is pluggable through Workflow SDK's World interface: Vercel World in production, local files in development, or Postgres, MongoDB, Redis or Turso when self-hosting; two environment variables switch an agent to Postgres.
- Claude Code and Codex always run in a Vercel Sandbox, since they expect a real shell and filesystem and aren't safe for multi-tenant use; other harnesses can use virtual(), a log-backed workspace whose shell can't reach the network.
- agent harness — The scaffolding around a model that turns it into a working agent — the loop, the tools it can call, and the rules for when to stop.
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
- token — The chunk of text a model reads and writes in — roughly three-quarters of a word — and the unit AI usage is billed in.
- sandbox — An isolated environment where AI-generated code or agent actions run without being able to touch anything real.
Checking sign-in…
Loading comments…


