Cloudflare shares an experimental Codex agent harness for Workers
Brief
Cloudflare’s experimental example runs Codex’s agent loop in a Durable Object and supports recovery after interruptions.
Persistence and recovery
- Tasks records model calls and tool execution, reusing completed results after a restart while interrupted steps can run again.
- Sessions stores conversation history and compacts model context; Streams stores events for replay after reconnecting; Workspace provides persistent file tools.
Model setup
- The example adapts Codex’s Rust turn-processing code to WebAssembly and configures OpenAI’s GPT-6.1 Sol through AI Gateway.
- Using the model requires Unified Billing on the default gateway or a stored OpenAI API key.
Generated by AI from the original article. Check the source for full details.