Skip to content

About

Durable nanocode agents on Cloudflare: one Durable Object per session, journaled in its own SQLite. A template and a live demo.

Topics

Resources

Stars

17 stars

Watchers

0 watching

Forks

Repository files navigation

durable-cloudflare

Live Demo · How It Works · Guide

nanocode agents in Cloudflare Durable Objects: one object per session, with the agent's journal in the object's own SQLite. A template and the source of nanocode.xyz/cloudflare.

A turn goes from the client through the Worker to the session object, which journals in its SQLite and is restarted by an alarm after a reset

  • Durable. Every model call and tool call is journaled. An object that resets mid-turn is started again by its alarm and continues from the last checkpoint.
  • No sandbox. Code Mode cells run beside the agent in the object: bash on a workspace kept in the same SQLite, git, Python (nanocode-ts's python.wasm, in the same object) and WebAssembly.
  • One module. The runtime is nanocode-ts, the Rust SDK compiled to WebAssembly. This repository holds the Worker, its tools and the page.

Run It

npm install
npm run dev       # wrangler dev, at http://localhost:8787
npm run drill     # Crash a turn midway and check that it resumes
npm run deploy    # Deploy the Worker

Model requests go through the account's AI Gateway (AI_GATEWAY_ID in wrangler.jsonc). DECISIONS.md records what each change established, with its measurements.

About

Durable nanocode agents on Cloudflare: one Durable Object per session, journaled in its own SQLite. A template and a live demo.

Topics

Resources

Stars

17 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages