Vibeleaderboard
← All Intel
Intel / article

Making every harness durable

Source
vercel.com
Publisher
Vercel
Author
Pranay Prakash
Date

Context

Vercel's durable-harness targets a specific failure: coding-agent 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 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 tokens 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 sandbox. 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 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.

Key takeaways · AI-distilled
  • 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.
Terms in this piece · Glossary
  • Function — A named block of instructions that takes inputs, called arguments, and hands back a result, called its return value.
  • Terminal and shell — A text interface for navigating files and running programs.
  • Agent mode — A mode in which one agent can inspect, edit, run commands, and iterate toward an outcome.
  • Durable agent execution — Persisting agent state so long-running work can resume after interruption.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

More from Pranay Prakash
Recommended reads