# durable-harness

Vercel's adapters that run existing coding-agent harnesses (Pi, OpenCode, fx, Claude Code, Codex) as durable agents on a Workflow SDK World, so a crash or function timeout resumes the turn instead of losing it.

**Type:** library
**Added:** 2026-11-01
**Source date:** 2026-10-20
**Link:** https://github.com/vercel-labs/durable-harness
**Topics:** AI Coding, Infrastructure, Open Source
**Tags:** agents, serverless, sandbox, typescript

---

Each agent session is a workflow run. The conversation, the turn in flight and every model and tool call go into the run's event log: an intent is recorded before a call and the outcome after it. If a function dies, a new one reads the log and resumes the turn on another machine. Completed calls aren't repeated, and a tool marked `replay: 'never'` is never run twice.

Pi (through `durable-harness/pi-durable`, the recommended path), OpenCode and fx run inside functions. Model-chosen commands and files go to a virtual workspace whose files live in the session log, or to the session's own Vercel Sandbox. Claude Code and Codex always run in their own sandbox, never in a shared function. `withDurableHarness` in `next.config.ts` discovers the agents in a Next.js app.

Local development uses the Workflow SDK's local World with no setup. On Vercel the sessions show up in Agent Runs, and self-hosting works with the Postgres World or another World. It's on `0.0.x` and marked experimental, Apache-2.0. Write-up: [Making every harness durable](https://vercel.com/blog/making-every-harness-durable) · docs: [Agent harnesses](https://vercel.com/docs/agent-harnesses).

---

## Links

- Directory entry: https://andrey-markin.com/directory/durable-harness
- All directory entries: https://andrey-markin.com/directory
- Contact: https://andrey-markin.com/#contact
