// AI Platform Drift

Cloudflare publishes experimental Agents SDK for durable agent execution

Cloudflare developer changelog · published 2026-11-13 06:48 UTC
WORTH KNOWING VERIFY_ONLY APIMODEL
WHAT CHANGEDCloudflare released an experimental Agents SDK example that runs the Codex agent loop on Workers with Durable Objects. The SDK provides Tasks (journals model calls and tool execution with replay after restart), Sessions (stores conversation history), Streams (stores ordered events for reconnection), and Workspace (persistent file operations). The example uses openai/gpt-6.1-sol through AI Gateway and requires either Unified Billing or a stored OpenAI API key configured on the default gateway.
WHY IT MATTERSAgent workloads that span multiple turns or require file persistence can now survive Worker restarts without losing conversation state or re-executing completed steps. This changes the deployment pattern for long-running agentic workflows on Cloudflare's edge, moving durability from application code into SDK primitives.
WHAT TO DOReview the Codex harness guide to evaluate whether durable agent execution fits your use case. If you run multi-turn agents on Workers today, compare your current state management approach against the SDK's Tasks journaling and Sessions compaction to decide whether migration reduces complexity.
Model-reported confidence 75% (not measured accuracy) Primary source ↗ written by anthropic/claude-sonnet-4.5
Show the reasoning — raw diff, triage verdict, confidence
RAW DIFF
+## Workers, Agents - Run the Codex agent loop on Cloudflare Workers
+https://developers.cloudflare.com/changelog/post/2026-11-09-codex-harness/
+Mon, 09 Nov 2026 00:00:00 GMT
+
+Run the Codex agent loop in a Cloudflare Durable Object with this experimental Agents SDK example ↗︎. Conversations, files, and completed model and tool results persist across restarts, allowing the agent to recover after interruptions.
+The example adapts Codex’s Rust turn-processing code ↗︎ to WebAssembly and uses Agents SDK capabilities for storage and recovery.
+The harness combines Agents SDK capabilities for durable execution:
+
+Tasks journals model calls and tool execution. Completed steps reuse their recorded results after a restart. Interrupted steps can run again.
+Sessions stores conversation history and compacts the model context.
+Streams stores ordered events for replay after reconnecting.
+Workspace provides tools to read and write persistent files.
+
+For example, use OpenAI's GPT-6.1 Sol through AI Gateway. Configure the model with createAI and install the capabilities on a Durable Object:
+import { DurableObject } from "cloudflare:workers";
+import { Workspace } from "@cloudflare/computer";
+import { Lifecycle } from "agents/lifecycle";
+import { createAI } from "agents/models/ai-sdk";
+import { Sessions } from "agents/sessions";
+import { Streams } from "agents/streams";
+import { Tasks } from "agents/tasks";
+import { CodexHarness } from "./codex-harness";
+
+export class Coder extends DurableObject {
+tasks = new Tasks();
+streams = new Streams();
+sessions = new Sessions();
+workspace = new Workspace({ storage: this.ctx.storage });
+
+codex = new CodexHarness({
+tasks: this.tasks,
+streams: this.streams,
+sessions: this.sessions,
+workspace: this.workspace,
+model: createAI({ binding: this.env.AI, id: "default" })(
+"openai/gpt-6.1-sol",
+),
+});
+
+lifecycle = Lifecycle.install(this)
+.use(this.tasks)
+.use(this.streams)
+.use(this.sessions)
+.use(this.codex);
+}import { DurableObject } from "cloudflare:workers";
+import { Workspace } from "@cloudflare/computer";
+import { Lifecycle } from "agents/lifecycle";
+import { createAI } from "agents/models/ai-sdk";
+import { Sessions } from "agents/sessions";
+import { Streams } from "agents/streams";
+import { Tasks } from "agents/tasks";
+import { CodexHarness } from "./codex-harness";
+
+export class Coder extends DurableObject<Env> {
+tasks = new Tasks();
+streams = new Streams();
+sessions = new Sessions();
+workspace = new Workspace({ storage: this.ctx.storage });
+
+codex = new CodexHarness({
+tasks: this.tasks,
+streams: this.streams,
+sessions: this.sessions,
+workspace: this.workspace,
+model: createAI({ binding: this.env.AI, id: "default" })("openai/gpt-6.1-sol"),
+});
+
+lifecycle = Lifecycle.install(this)
+.use(this.tasks)
+.use(this.streams)
+.use(this.sessions)
+.use(this.codex);
+}
+To use this model, configure the default gateway with Unified Billing or a stored OpenAI API key.
+For setup, models, tools, and recovery behavior, refer to the Codex harness guide.
HOW IT WAS JUDGED
Triage signals below are model-reported assertions, preserved verbatim; they are not independent arithmetic verification.
triage verdictMATERIAL at 0.78, needed 0.5
triage reasoningNew model, SDK, and deployment pattern for agent workloads on Cloudflare platform.
signalsnew model introduced: openai/gpt-6.1-sol · new SDK capability: Agents SDK with Tasks, Sessions, Streams, Workspace · new deployment pattern: Codex agent loop on Cloudflare Workers + Durable Objects · new integration: AI Gateway configuration requirement · future date: 2026-11-09 (announcement of new capability) · authentication change: requires Unified Billing or stored OpenAI API key
suppression—
triage modelanthropic/claude-haiku-4.5 ($0.00000)
writer modelanthropic/claude-sonnet-4.5 ($0.00000)