Nanocode on Cloudflare Makes Agent Recovery the Real Deployment Feature
Nanocode can run in Cloudflare Durable Objects with SQLite-backed progress. For long tasks, recovery matters more than a successful first boot.
When I run a long task on Kubernetes, the scary failure is not always a pod that never starts. It is a task that works for twenty minutes, gets evicted, and comes back with no idea what it has already done. Coding agents have the same failure mode.
On November 9, Cloudflare announced that Nanocode coding agents can run in Cloudflare Durable Objects. The host stores session progress and tool results in SQLite, then uses alarms to resume pending work after interruptions. Nanocode’s Rust engine runs as WebAssembly and follows prompt and tool conventions used by Codex and Claude Code. Cloudflare Agents changelog
The interesting part is not simply putting an Agent “at the edge”. The useful words are progress, results, and resume. A long-running Agent needs a durable record of where it is, what it has called, what each tool returned, and what can safely happen next.
Make the work resumable before making it autonomous
For a repository-changing Agent, I would record at least the task, executed tools, tool output, next action, and a retry boundary. Without that state, recovery means asking the model the same question again. That is a restart, not a continuation.
A small table captures the shape I want:
CREATE TABLE turns (
id INTEGER PRIMARY KEY,
status TEXT NOT NULL,
tool_name TEXT,
result_json TEXT,
next_action TEXT,
updated_at INTEGER NOT NULL
);
This is not Cloudflare’s required schema. It is a worked example of the information I would preserve. I prefer writing the tool result before scheduling the next action. That ordering makes a crash easier to reason about. Every tool that can create an external side effect needs an idempotency key. Otherwise, a recovery alarm can create a duplicate pull request, upload the same file twice, or repeat an external write.
A Durable Object is not an immortal VM
Durable Objects provide a useful coordination unit for stateful sessions, but they are not a forever-running host. Cloudflare describes the combination of persistence, SQLite, and alarms; it does not promise that every model or tool call will succeed. Timeouts, expired credentials, rate limits, and partial external writes still belong to the application’s failure design.
I would classify tools by effect. Read-only queries can usually retry. Write operations need an idempotency key and a confirmation read. Dangerous operations need a human gate. On recovery, the system should check whether the last result has already landed before replaying the call.
That last point matters for infrastructure. If an Agent changes a Kubernetes object, its own written explanation is not proof that the object exists. The controller or API response needs to be read back. The same applies to a cloud deployment, a database migration, or a billing action.
Cloudflare’s developer platform changelog also describes running Exo agents with Durable Objects and Sandboxes, alongside a reference path for Nanocode. Cloudflare Developer Platform changelog These are useful building blocks, but a working sample does not establish production capacity or recovery behavior for a particular workload.
The first test I would run
Before connecting a business workflow, I would give the Agent a repeatable task: inspect a repository, write a plan, create a temporary file, and stop deliberately before the next step. After recovery, it should find the existing result, avoid rewriting the file, and move to a reviewable state. Then I would inject a tool timeout and an authorization error.
The test has four questions: can state be read back, can a retry duplicate a side effect, can an alarm wake the pending task, and can a human take over from an error state? If those answers are unclear, adding more tools or a larger model will increase the recovery cost.
Cloudflare’s update changes how I think about Agent hosting. The unit being deployed is becoming an interruptible piece of work, not merely a chat endpoint. I would not move every background job into Durable Objects yet. I would start with a low-side-effect task that has explicit checkpoints and can be replayed. When the recovery record is more trustworthy than the model’s narrative, the design is ready for a wider test.
