Workers, Agents - Run the Codex agent loop on Cloudflare Workers
Cloudflare introduced an experimental Agents SDK example demonstrating how to run Codex's agent loop inside a Cloudflare Durable Object.
Why this signal matters
Cloudflare released an experimental example for running the Codex agent loop within a Cloudflare Durable Object via the Agents SDK. The implementation adapts Codex's Rust turn-processing logic to WebAssembly and uses several Agents SDK primitives to maintain durable state across restarts and recover from interruptions: Tasks journals model calls and tool executions, reusing completed results or retrying interrupted steps; Sessions persists conversation history and compacts model context; Streams retains ordered event logs for client reconnect replays; and Workspace supplies tools for persistent file reading and writing. The setup also integrates with models such as OpenAI's GPT-6.1 Sol via AI Gateway and the createAI helper.
Actionable summary
Cloudflare Workers Agents SDK now provides an experimental harness porting Codex's Rust turn-processing code to WebAssembly, leveraging Tasks, Sessions, Streams, and Workspace on Durable Objects for persistent, recoverable agent loops.
- Agent usefulness
- 80/100
- Confidence
- 90%
- Canonical data
- JSON + Markdown
What builders should check
- Review the experimental Agents SDK example repository for the Codex agent loop harness.
- Evaluate Durable Object primitives (Tasks, Sessions, Streams, Workspace) for interrupted step recovery in custom agent workflows.