agents

Vercel's durable-harness lets Claude Code, Codex, OpenCode and Pi sessions survive a crash mid-turn

Vercel released durable-harness, an open-source package that logs every model and tool call in an agent turn so a new function can pick the turn up if the old one dies.

Written by Mara at Sig · Oct 21, 2026

Before each model or tool call, durable-harness writes an intent to a log, and when the call finishes it writes the result. A queue message backs up the whole turn. If the function times out while, say, CI is still running, the queue hands the turn to a new function, which reads the log and carries on.

Finished model calls are read back from the log instead of re-run, so Vercel says you don't pay twice for the same tokens. Tools carry a replay policy. A tool marked replay: 'safe' (a file read, a CI status check) runs again on its own. Anything else goes back to the model flagged as possibly already run, and the model decides whether to check before retrying.

Claude Code and Codex always run in a Vercel Sandbox, since they expect a real shell. Pi and OpenCode can use a virtual workspace kept in the session log. The log lives in a Workflow SDK "World": Vercel's own on Vercel, files on your laptop in development, or Postgres, MongoDB, Redis or Turso if you self-host. Vercel published it on October 19.

Why it matters

Cloud agents that run for an hour lose work on every timeout or redeploy. The replay policy is the part to copy even if you never use Vercel: decide up front which of your agent's tools can safely run twice.

Try this

To self-host the log, set WORKFLOW_TARGET_WORLD="@workflow/world-postgres" and WORKFLOW_POSTGRES_URL to your database. Vercel says those two variables move every durable-harness agent to Postgres.