Codex agent loop moves into a Cloudflare Durable Object: conversations, files and finished steps survive a restart
Synopsis
Cloudflare published an experimental Agents SDK example that adapts Codex's Rust turn-processing code to WebAssembly and runs the agent loop inside a Durable Object. Previously an interrupted agent could not easily carry its conversation and tool results forward; the example uses Tasks to journal model calls and tool execution, Sessions to store conversation history and compact context, Streams to store ordered events for replay after reconnecting, and Workspace for persistent file tools, so completed steps reuse recorded results after a restart and interrupted steps can run again.
Interpretation
The agent loop can now run inside a Cloudflare Durable Object, with conversations, files and completed model and tool results persisting across restarts so the agent can recover after interruptions. Earlier operation did not combine this persistence and recovery; the example adapts Codex's Rust turn-processing code to WebAssembly and relies on Agents SDK storage and recovery capabilities to carry the whole loop. The claim rests on the recovery behavior the example describes: Tasks journals model calls and tool execution, completed steps reuse their recorded results after a restart, and interrupted steps can run again.
Recovery is split across four Agents SDK capabilities rather than a single snapshot. Tasks keeps a journal of model calls and tool execution, Sessions stores conversation history and compacts the model context, Streams stores ordered events for replay after reconnecting, and Workspace provides tools to read and write persistent files. The example uses OpenAI's GPT-6.1 Sol through AI Gateway, configuring the model with createAI and installing the capabilities on a Durable Object; using this model requires the default gateway configured with Unified Billing or a stored OpenAI API key.
Perspective
The example targets developers building recoverable agent loops on Cloudflare Durable Objects, and its demonstrated scope is the WebAssembly adaptation of Codex's turn-processing code plus the combination of Agents SDK storage and recovery capabilities; further detail on setup, models, tools and recovery behavior is directed to the Codex harness guide.
The example is explicitly labeled experimental; using GPT-6.1 Sol requires the default gateway configured with Unified Billing or a stored OpenAI API key, and the specifics of recovery behavior follow what the Codex harness guide states.
