So I Made an Easy Cloud Coding Agent as an API
I got tired of watching coding agents spin up from scratch every single time I sent them a prompt. Cold starts, re-cloning massive monorepos, pasting the previous context into a synthetic prompt block — it worked, but it felt fundamentally wrong for agents that are supposed to think in conversations. So we shipped persistent sessions for the Critique Coding Agent API . Here's what changed, why the harness matters, and why you should never run a coding agent without a review skill. The Problem: Agents That Forget When we first released the Coding Agent API, follow-ups were honest but clunky: every follow-up was a brand-new job. The previous output was replayed as plain text into a fresh sandbox. It was the right MVP. It billed predictably. It never pretended a dead sandbox was alive. But it was the wrong long-term shape. If your internal bot fixes a migration, then wants a follow-up test, then wants a small doc tweak — you don't want three cold starts. You want: One repository checkout One OpenCode session A control plane that understands turns What Changed: Persistent Sessions After the first turn completes, the run now enters idle status. The E2B sandbox and OpenCode server stay up until sessionExpiresAt or until you explicitly POST endSession: true . The next prompt you send is delivered as a real message in that same session — not a synthetic "prior run output" block in a brand-new sandbox. Before (Chained MVP): Turn 1 completes → Sandbox killed → Turn 2 = new job + pasted prior summary Now (Persistent): Turn 1 completes → idle → Sandbox warm → Turn 2 = message into same OpenCode session Same run.id . Same checkout. Same context. Just the next turn. How It Works Under the Hood On the first turn, Critique: Creates an E2B sandbox from the OpenCode template Clones your repository at the requested ref Bootstraps tooling and starts opencode serve on localhost inside the VM Opens an OpenCode session Instead of killing that sandbox after completion, we now store session