npm / agents
agents
What changed in agents 0.2 to 0.33, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-04.
157 breaking17 security16 deprecations316 new APIs and options11 performance89 behavior and defaults6 tooling174 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initagents 0.3328 changes
Breaking changes 7
The
Harness.opencallback now takes one report tagged bykind, with the error on it;session_failedbecomesstorage_failed, andtask_parkedbecomestask_interrupted.The pending status is removed; crash-looping tasks now end instead of parking.
The Pi harness, pi-ai models, and Pi tools support Pi 1.5; Pi 1.4 is no longer supported, and conversations run on Pi 1.5 cannot be read by Pi 1.4.
Removed; use
session.continue()or submit again to run work after a run ends without an answer.Removed in favor of
session.watch().Replaces
session.events()with a conversation view containing newest transcript entries and live session state.pi-ai no longer exports TypeBox's
Type; import it fromtypeboxto keep using TypeBox.
New APIs and options 12
Adds
Browser.functionDocs()to the browser tools API.Adds opt-in scope locks through
browser.session({ lock: true }).Lets code outside
browserToolrun the samebrowserobject.Adds the
functionsproperty toBrowserSession.Adds
conversationScope()to the browser tools API.Caps the tool rounds a run can take in new sessions; reaching the limit ends the run without an answer, with reason
turn_limit.New optional peer package for building Pi tool schemas; its
obj()rejects unlisted properties unless{ open: true }is passed.Adds report notices to the browser tools API.
Starts a run on the existing transcript without sending a new message, including after a run ends without an answer.
Pages older transcript entries for conversations longer than the watch window.
Adds an API for opt-in scope locks.
Accepts
whenIdle: "reject"so an idle session refuses input instead of starting a run.
Performance 2
The scheduler no longer rechecks every conversation on each commit; concurrent commits share one storage call, and a normal run makes no storage reads.
Pi appends new text instead of copying it on every update, reducing CPU and memory use for large streamed answers and tool calls.
Behavior and default changes 3
In Pi code mode, gives scripts the run as an object and supplies screenshots as image blocks for
image().Tasks cut off by Pi's restart limit end with an error result visible to the model; model requests end without an answer with reason
restart_limit.Pi batches streamed answers and tool output, writing at the latest every second instead of on every update; a crash can lose up to about a second of streamed output.
Fixes and other changes 4
Stops when the harness aborts its call for Pi, the AI SDK, and TanStack AI.
An idle
pi.livekeepsrunFailureafter a failed run; checkrun === undefinedinstead of comparing it with{}.Pi models on the chat-completions wire now parse arguments with pi-ai's parser; invalid JSON fails the tool call with an error the model can see and fix.
Cancels server-started turns streamed without a resume handshake.
agents 0.3213 changes
Breaking changes 6
The Vite import is removed.
The compile entry point is removed.
Replaces SkillRegistry with a new API for creating skill tools from
agents/skills/tools/ai-sdk.Replaces SkillRegistry with an API for loading Agent Skills from workspace files, R2, or code.
The runner entry point moves to
agents/skills/runner.The skills API replaces SkillRegistry with
loadSkillCatalog()andcreateSkillTools().
New APIs and options 2
Adds a
clientMetadataUrloption for OAuth Client ID Metadata Documents.Adds an experimental API that records spans from OpenTelemetry-instrumented libraries as Workers trace spans.
Performance 2
Marking the package side-effect free lets bundlers drop unused modules; importing routeAgentRequest no longer bundles the MCP client.
Parses streamed chat-completions tool-call arguments incrementally instead of re-parsing the whole argument text on every delta.
Behavior and default changes 2
Follows the Agent Skills spec's guide for agents, loading skills that break a rule with warnings.
Allows TanStack AI 1.x in optional peer dependency ranges and types its tools to compile against both 0.x and 1.x.
Fixes and other changes 1
Agents SDK spans for lifecycle, wrapAISDK, and Think now set status to error on failure where supported by the Workers runtime.
agents 0.3115 changes
Breaking changes 5
Model code uses browser.cdp(...) instead of cdp.send(...).
Results provide notice sentences about browser restarts, tabs opened, and another chat closing or sharing the tab, replacing restarted and newTabs; the output no longer includes a calls log.
Runs model code in its own Dynamic Worker instead of codemode, no longer requires ctx or a CodemodeRuntime export, and code execution is stopped externally if it exceeds its timeout.
This package is now an optional peer dependency; apps using the listed MCP integrations must add it to package.json.
The type now has only executionId and status.
Deprecations 2
Deprecated in favour of browserTool.
Quick Action helpers are deprecated and will not change.
New APIs and options 5
Let the model point an internal hostname at a specific target, such as a container port or workspace folder.
Lets your own code drive the same browser connection used by browserTool.
The browser global exposes browser.spec({ domain }) to model code.
Pass up to 8 internal hostnames to browserRun() so browser requests to them go through your agent instead of the internet.
Accepts the value "reject".
Behavior and default changes 3
This model integration is no longer experimental.
createAI now sends pi-ai's betas as the anthropic-beta header for catalog Claude models on /run.
createMcpHandler passes the verified OAuth token details to tool callbacks through context.http.authInfo.
agents 0.3011 changes
Breaking changes 3
The Pi harness now supports Pi 1.4; its peer range is ~1.4.0, and Pi 1.4's session-storage migration prevents deployments from rolling back to Pi 1.3.
Install @earendil-works/chord alongside pi-durable and pi-ai because agents/harness/pi now uses chord's context helpers.
Operations stopped by Pi's restart limit appear as parked in pending(), and retry() runs them again; callers switching on PiPendingOperation.status should handle the new status.
New APIs and options 1
PiHarness passes onWake to the harness factory for Harness.open, allowing the Durable Object to hibernate while Pi's tasks sleep; without it, the harness logs a warning.
Fixes and other changes 7
Fixes onWake not resuming a sleeping Pi task, such as a compaction retry, while another task is running.
Cut-off or idle model streams are reported with wording Pi treats as transient, so Pi retries the turn instead of failing it.
Lifecycle arms a fallback alarm when queued jobs could otherwise be left without a wake after startup fails.
Lifecycle startup no longer keeps an evicted Durable Object in memory when a capability leaves a promise pending.
PiHarness wakes from Pi's wake() with one job per object, so a task parked by the restart limit no longer keeps the Durable Object awake.
PiHarness reopens Pi after a storage error closes it, rather than failing every call until the object restarts; the harness factory may run again.
PiHarness preserves its wake job when a step fails, retries with backoff up to 10 minutes, and counts a memory-limit reset during the wait against the alarm memory-limit breaker.
agents 0.2913 changes
Breaking changes 3
createAI takes { accountId, apiToken } in place of binding, allowing use of a gateway in another account or outside a Worker.
createAI stops using AI Gateway's deprecated Universal Endpoint; model ids run on env.AI.run, while model objects use the provider-native path. Catalog ids are supported, including by agents/models/opencode.
Pi web search, web fetch, browser, and skills tools return output; the Pi peer range is now ~1.3.0.
Deprecations 1
maxOomRetries is deprecated in favor of chatRecovery.maxInterruptedAttempts.
New APIs and options 3
Adds byokAlias.
Sets the interrupted-attempt limit before chat recovery seals a turn; it defaults to 5, preventing endless retries when every run exceeds the Durable Object memory limit.
submit() and steer() accept pi-durable's entry option to label input with a custom transcript kind instead of pi.user.
Behavior and default changes 4
Browser uses the binding's typed acquire() and closeSession() to manage Browser Run sessions, falling back to the HTTP API in fully local dev.
Agent Skills read and write a @cloudflare/computer Workspace for both projection and skills.runner().
createAI transcribes with @cf/deepgram/nova-3.
Uses pi-durable's Durable Object SQLite adapter so several Pi storages in one object share its operation queue.
Fixes and other changes 2
Resolves Claude ids from pi-ai 1.2's gateway catalog using AI Gateway's spelling.
Resumes catalog or dynamic route streams that drop mid-answer without losing or repeating content.
agents 0.2816 changes
Breaking changes 4
Rejects a Legacy request when its factory returns an instance still serving another request without closing that instance.
Requests for a session ended with DELETE now receive 404 immediately instead of being served until deferred teardown runs.
MCP client transports now follow redirects only within the same origin.
OpenCodeHarness session.events() now streams a session snapshot followed by events translated into the kinds PiHarness reports; raw OpenCode events remain available and resumable from session.log().
New APIs and options 6
AI Gateway dynamic routes can be selected with ai("dynamic/<route>").
AI SDK models routed with your own vendor key can use vendorKey: "request".
Adds the zdr gateway option to createAI for AI SDK and Pi AI models.
Adds a tool for creating and manipulating a persistent browser session, available through the pi, ai-sdk, and tanstack-ai integrations.
Adds
browserTool()to the pi browser integration.Adds a tool that reads URLs as Markdown, JSON, or text, including HTML, PDF, and Office documents via Worker AI.
Behavior and default changes 6
The lifecycle capability is now stable.
The MCPClientManager capability is now stable.
The Scheduler capability is now stable.
The State capability is now stable.
ThinkHarness keeps sessions and operations in the shared
agents/harness/store; migrations run on first run.The WebSockets capability is now stable.
agents 0.2736 changes
Breaking changes 7
Removes the first-pass Channels entry points and API; Channels moves to agents/experimental/channels, and the old helpers and composites are removed.
Moves Email to the experimental Channels entry point while retaining verified ingress and normalization.
Moves Slack to the experimental Channels entry point while retaining verified ingress and normalization.
Moves Telegram to the experimental Channels entry point while retaining verified ingress and normalization.
Ingress Channels require a participant callback so the application identifies the sender; Channels does not choose an identity.
Rejects immediately when the supplied signal is already aborted instead of remaining pending until the operation settles.
send() and listConversations() reject after the client closes; follow() and close() cancel pending reconnects to avoid unwanted sockets.
Security 1
Adds a way to provide credentials outside the container, which only sees a placeholder key.
New APIs and options 17
Adds a draft harness interface for Channels; the interface may change.
Adds a terminal client for a conversation's Web Channel with live transcripts, approvals, client tool results, and turn cancellation.
Adds an AI SDK harness that runs messages with streamText and keeps sessions and transcripts in the Durable Object, enabling Channels.forHarness to serve an AI SDK model.
Adds a Worker entry point for verifying channel webhooks, routing Web Channel upgrades to conversation-owning agent objects, and delivering outbound messages.
Adds an experimental Lifecycle capability that serves harness sessions as conversations to joined surfaces, with durable, resumable responses on Streams.
Connects a harness to Channels using a channels configuration.
Adds an experimental harness that runs agent CLIs such as Claude Code or Codex in a Cloudflare Container and drives them from a Durable Object.
Adds an OpenCode plugin factory that serves Workers AI models through the AI binding.
Adds an AI SDK tool for sending a message to a surface through the gateway.
Adds headers to the WebSocket upgrade made by the terminal client.
Adds an experimental OpenCode v2 harness hosted in a Durable Object, with session recovery after eviction and hibernation when idle.
Adds a callback for sharing an agent object between participants or refusing them.
Adds a Think agent-loop harness with durable sessions, resumable turns, and the shared harness interface served by Channels.
Adds a Web Channel and client for browser and terminal access to conversations over agent WebSockets, including transcript, turns, approvals, client tool results, and conversation operations.
Adds a tool over Cloudflare's Web Search API for the pi harness, the AI SDK, and TanStack AI.
Adds an AI SDK ChatTransport over the Web Channel so AI SDK UIs can join a Channels conversation.
Adds use for protocol handlers that run before the configured WebSocket handlers.
Behavior and default changes 4
Gets a tool-specific description covering the cdp API, common mistakes, runtime limit, and screenshot result limit, so the model no longer runs codemode.search first.
AiSdkHarness passes tools to convertToModelMessages so each tool's toModelOutput shapes results on later turns instead of exposing raw JSON output.
Clears the removed server's saved OAuth state from Durable Object storage, including tokens and pending or discovery state, without affecting other servers or revoking provider tokens.
Handles Cloudflare Access by obtaining a token from cloudflared and sending it on the WebSocket upgrade; explicit credentials take precedence.
Fixes and other changes 7
Fixes startup with stored sessions so a restarted agent continues acknowledging messages.
Drops a URL fragment before connecting because WebSocket URLs cannot carry one.
Live read and readBatches re-poll before waiting for the next append, preventing readers from stalling when chunks arrive while a batch is being handled.
Rechecks that the v1 chunk table exists before using it, preventing append failures when another Streams instance folds rows and drops the table.
A routed wake whose owner facet is no longer registered ends quietly instead of throwing Invalid job outcome on the alarm.
Replaces a cut-off assistant reply with the server's copy after a mid-stream WebSocket disconnect when the server sends that copy on reconnect.
Reads payments from MCP SDK v2 servers and matches payment headers case-insensitively.
agents 0.2544 changes
Breaking changes 3
Rejects immediately when its socket is closed instead of waiting for the timeout.
Async Agent and Think RPC calls now start lifecycle initialization first; address Agents by name because raw IDs from newUniqueId() and idFromString() fail their first async RPC.
Calls onToolCall only after the stream ends, and only for tool calls still waiting on the client.
Security 2
Introduces the CdpConnection name alongside Browser Run hostname guardrails and close and activity callbacks; CdpSession remains a deprecated alias.
Enforces maxPaymentValue against the payment requirement selected for signing, before signing or retrying the tool call.
Deprecations 2
CdpSession remains available as a deprecated alias for CdpConnection.
Deprecated in favour of reconcileMessages.
New APIs and options 11
An experimental harness can host pi-durable sessions in a Durable Object.
An experimental provider for Workers AI and AI Gateway over the AI binding is available.
An experimental pi-ai provider for Workers AI and AI Gateway over the AI binding is available.
The remind mode sends changes as a reminder after the cached prompt instead of rewriting it.
Accepts an optional sessionId to read the protocol from an existing Browser Run session.
Persistent browser tools for AI SDK and TanStack AI are available, backed by experimental Browser sessions.
Interfaces can now be used as Props on Agent, AIChatAgent, Think, and routing helpers.
Provides the replacement for deprecated resolveToolMergeId and keeps assistant messages and tool outputs attached to the correct turn when providers reuse a toolCallId.
The new terminal event-delivery mode forwards only lifecycle, progress, and milestone events for a run.
Keeps an in-memory transcript in sync with a session's change feed.
Gains onTurnEnd; terminal chat frames carry outcomes and user message IDs so clients can settle sends across recovery and reconnects.
Performance 1
Detects unchanged messages from a stored content hash, cutting reads on large messages.
Behavior and default changes 2
Includes command parameters, return types, and type details so a model can see how to call a CDP method.
When enabled, oversized tool payloads are recorded with base64 data summarized instead of being dropped.
Fixes and other changes 23
An agent-tool child is reported as failed even if it was evicted before its failure was recorded.
Chunks are no longer duplicated or dropped during reconnect, child re-attach, or fiber recovery.
Approved tool calls that never ran are settled once the conversation moves past them, preventing later turns from sending unresolved tool calls.
References are retained when a message already containing attachment pointers is written back, preventing its media from being garbage-collected.
Throws BrowserRenderingError with the HTTP status when Browser Run returns no WebSocket.
Closes the sub-agent's direct client connections so late messages cannot recreate it.
Replies hold the thread lock and retain queued follow-ups during slow delivery; typing updates are serialized and settle before reply text arrives.
Still fires, with recovered: true, for a turn persisted just before a Durable Object reset.
A regeneration interrupted by a restart now recovers on its own branch.
Prevents text from appearing twice when reconnecting during a tool continuation.
No longer calls onFiberRecovered for work that already finished.
Make at most one root call, and none when no client would receive the broadcast.
Clients stop reconnecting after a sub-agent rejects a WebSocket; connection errors report every close that ends reconnection, and terminal rejections use close codes 4000 + status.
WebSocket connections to sub-agents nested more than one level deep are fixed.
No longer sync root-owned host jobs, avoiding failures on a facet's first call after restart.
Input is retained when an approval request arrives before input streaming finishes.
Older tool results are truncated after model conversion so toModelOutput and provider-executed tools keep valid outputs.
Recovery across Think and AI Chat is hardened, including retry budgeting, cancellation, terminal error delivery, and recovery after restarts.
Loads the new agent's history when the address passed to useAgent changes.
A WebSocket close before the final done frame now puts the hook in the error state instead of showing a truncated answer as complete.
The server snapshot can repair a scrambled cross-tab or resumed assistant message instead of leaving it scrambled until reload.
Messages sent while disconnected, including Think transcripts, are kept when reconnecting instead of being erased.
Fixes Maximum update depth exceeded errors during long streamed answers.
agents 0.2419 changes
Breaking changes 9
queue() accepts options.id; queued callbacks run in a fresh alarm-loop invocation and no longer receive the enqueuing request's connection or request through getCurrentAgent().
The experimental Cap'n Web RPC endpoint is removed.
Lifecycle capabilities declare traffic ownership with selective or catch-all claims instead of hosts passing fallback to lifecycle.use(); catch-alls dispatch last and are unique per hook.
dequeue, dequeueAll, dequeueAllByCallback, getQueue, and getQueues are now asynchronous.
starting() is replaced by status(), which returns zero, starting, or started.
LifecycleUseOptions is removed.
WebSockets uses protocol instead of the previous identity option to control the Agent protocol per connection.
QueueItem.created_at is renamed createdAt.
Delivery retries use backoff capped at ten minutes and stop after twelve hours of continuous failure, reporting the failure through onError.
New APIs and options 7
Adds a Queue Lifecycle capability for durable background jobs, with constructor-registered callbacks, typed pushes, stable IDs, per-item retries, and Lifecycle job-queue policies.
LifecycleServices exposes the name and className fields.
Exposes pendingCutoverId so callers can detect whether a finished stream still awaits its cutover.
Adds an opt-in State Lifecycle capability that owns durable state storage, lazy loading, initial-state seeding, validated persistence, and schema migration.
useAgent and AgentClient accept transport to select cf-websocket or capnweb; capnweb uses a native Cap'n Web session for callables, streaming, live stubs, and pipelined calls.
Hosts can drive the connection protocol sequence using sendIdentity, sendState, applyStateFrame, isReadonly, setReadonly, isProtocolEnabled, and setProtocolEnabled.
WebSockets accepts a State capability, sends current state to new protocol-enabled connections, validates client state frames, and can broadcast changes excluding their source.
Behavior and default changes 1
Plain Durable Objects composed with WebSockets can serve an RpcTarget as their remote interface for useAgent and AgentClient.
Fixes and other changes 2
The pending-cutover marker is cleared only after settlement succeeds, keeping failed settlement retryable.
A bookkeeping-row deletion failure is logged and leaves the row for recovery instead of replacing the fiber body's result.
agents 0.2345 changes
Breaking changes 17
Adds a module for prompt context, including ContextBlocks, the frozen system prompt, and context, search, and skill providers.
The experimental memory session subpath is removed, along with Session.create() and the listed legacy providers and interfaces.
The experimental memory utilities subpath is removed.
Adds an experimental Lifecycle capability for durable conversation storage, including branched messages, compaction overlays, streamed byte-budgeted reads, and full-text search.
The durable calls log is no longer sent to the model, though it remains in the persisted tool part for UIs and audit.
Existing scheduler rows migrate into the durable jobs queue on startup, and the legacy schedule table is dropped.
Removes stream-buffer cleanup from agents/chat; the host callback remains a no-op so alarms persisted by earlier versions still resolve.
Removes the pull-based alarm-contribution API; Lifecycle's durable job queue now drives due work.
Removes the minRecentMessages argument; the byte budget is now a hard ceiling, while the newest message is always returned.
Job ids are scoped to their owning capability; cross-owner collisions throw. Same-id pushes or reschedules during dispatch supersede the drive result, and due jobs are refetched before dispatch.
Removes Lifecycle's broadcast API as WebSocket functionality moves into the WebSockets capability.
Removes the alarms service, including rearm and disabled controls, as part of replacing alarm contributions with durable jobs.
Becomes a thin adapter over Streams; existing chat stream tables migrate on first construction after upgrade, including in-flight streams, and are then dropped.
Setting retain to false removes failed and cancelled task runs as well as completed runs, releasing journals and idempotency keys after every terminal outcome.
Scheduler retains its public API but stores schedules as Lifecycle jobs; interval schedules are single-flight, and existing schedule rows migrate on startup.
A change-feed listener that throws is reported through this capability event instead of rejecting the write.
Adds an opt-in capability that owns WebSocket upgrades, hibernating connections, handler dispatch, close handshakes, and connection lookup; without it, upgrades are declined.
Deprecations 1
The legacy sub-agent methods remain behaviorally unchanged and delegate to the dynamic-agents capability, but are deprecated in place.
New APIs and options 17
Makes Channels available through an explicit subpath export with provider adapters and streamed outbound delivery through ChannelHost.stream().
Adds an experimental Lifecycle capability for durable incremental output, with ordered chunk logs, append and settlement operations, replay-and-tail reads, tags, SSE responses, and status inspection.
Adds an experimental Lifecycle capability for durable, replayable background execution with named task definitions, journaled steps, sleeps, retries, progress, idempotency, inspection, cancellation, and retention.
Makes Voice available through an explicit subpath export with isolated types, client, React, errors, Workers AI, SFU, and text entries.
AIChatAgent and Think expose their backing Streams capability, allowing any streams.read() consumer on the same Durable Object to observe chat streams.
Lets a parent explicitly credit progress when forwarding a sub-agent's output.
Adds DynamicAgentClass and DynamicAgentStub type names; SubAgentClass and SubAgentStub remain compatibility aliases.
history({ newestFirst: true }) streams the active path from leaf to root, fetching one row per message the consumer takes; compaction overlays are planned when the walk reaches a compacted span.
Adds Lifecycle configuration for the alarm memory-limit strike budget.
Adds a durable job queue for capabilities and hosts. Jobs are dispatched by Lifecycle on alarm events, with retries, failure deferral, and automatic alarm re-arming.
Accepts fallback: true to dispatch a capability after every non-fallback capability regardless of installation order.
Marks job rows as recovery-loop work so the memory-limit breaker backs them off on a strike and purges them when the strike budget is reached.
Capability job handlers receive due jobs and can complete, suspend, or yield them through their drive result.
Adds an optional capability hook for reacting to an alarm memory-limit strike.
Adds a Lifecycle capability for maintaining a durable catalog of independent top-level Agents and routing requests to them by public ID.
Adds a capability facade with get, abort, delete, has, and list for dynamic agents; facets are positioned as an isolation primitive rather than the recommended way to model many chat sessions.
Tracks handed-off job work within the alarm's memory-limit breaker domain after the alarm returns, recording a strike if that work causes a memory reset.
Behavior and default changes 6
Inline bytes for non-text media parts are stored separately by SHA-256 and restored verbatim on read, keeping message rows small regardless of payload size.
Legacy stream chunk rows are folded into rollover blocks lazily on first touch, and the table is dropped after it empties.
The change feed now reports import for each row importMessage() writes and compaction for overlays stored through addCompaction().
Moves from 1000 to 10000 so the work budget remains as generous as before when measured in durable segments.
A dispatch that outlives its job's hung timeout logs a warning and emits this telemetry event; keep onJob bounded and detach unbounded work.
Stream settlement can run caller-supplied synchronous writes and delete stream rows in one SQLite transaction.
Fixes and other changes 4
Returns the same message whether inserted or found as a duplicate, and dispatches its append event before auto-compaction runs.
Structured tool outputs in compaction summaries are serialized as JSON instead of [object Object], matching the rendering of tool inputs.
Derives the recovery forward-progress marker from durable stream segments rather than a per-chunk KV counter, keeping it monotonic across cutover and reclaim.
Queued connection operations complete before the connect handler returns, preserving state set in onConnect for the first client message.
agents 0.2218 changes
Breaking changes 5
The published agents command-line binary is removed; use the documented C3 starter, Vite and Wrangler commands, and MCP APIs instead.
Chat recovery is now unconditional for AIChatAgent and Think, and chatRecovery accepts true or a configuration object; false is no longer supported and receives the default configuration in previously compiled JavaScript.
The storage option is removed; the manager receives storage from its installed Lifecycle, so standalone construction with explicit DurableObjectStorage is no longer supported.
Scheduled callbacks now receive the parsed Schedule object as their second argument instead of the raw storage row with an unparsed JSON payload.
Lifecycle WebSockets always use Cloudflare's Hibernation API; the static options.hibernate switch and in-memory connection mode are removed.
Deprecations 1
The previous schedule parser entry point remains available as a deprecated compatibility alias.
New APIs and options 5
Adds the package entry point for the reusable Scheduler capability.
Standalone Durable Object hosts can install the reusable lifecycle for startup, request interception, alarms, and WebSockets; Agent now directly extends Cloudflare's DurableObject and composes that lifecycle.
Agent exposes its composition root through experimental lifecycle and scheduler properties.
Adds a reusable Lifecycle capability for persistent delayed, dated, cron, and interval callbacks, with typed callback names and payloads registered on the Scheduler.
Chat UI updates are coalesced every 50ms by default; pass false to render every chunk or a number to change the interval. The first stream chunk is never delayed.
Behavior and default changes 3
MCPClientManager can be installed as a reusable Lifecycle capability and then owns schema initialization, connection restoration, and OAuth callback interception while preserving Agent MCP APIs.
Return { continue: false } to keep durable bookkeeping while preventing automatic inference after an interruption.
SDK-created spans now include Agents SDK instrumentation and agent instance identity attributes.
Fixes and other changes 4
Responses are routed through the facet WebSocket frame that originated each RPC.
Compaction overlays remain scoped to their selected conversation branch and retain deterministic ordering when created in the same second.
Operations remain routable and ordered across live and delayed contexts and before broadcasts; routing failures are reported and nested broadcasts are preserved across RPC callbacks.
Older Workers runtimes that expose tracing without startActiveSpan now fall back to no-op tracing instead of failing Agent initialization.
agents 0.2117 changes
Breaking changes 11
Large base64 values outside the canonical browser_screenshot shape are redacted; return screenshots in that shape or store binary output elsewhere.
Validates tool arguments before execution and rejects JSON-stringified Browser Run extraction schemas with an actionable error.
Zod is no longer a peer requirement; custom schemas must use an AI SDK adapter or wrap raw JSON Schema with jsonSchema().
The callback adapter is removed; users must wrap the AI SDK namespace and call the wrapped functions instead.
Direct browserExtract() and runQuickAction() callers must use response_format.json_schema instead of response_format.schema.
Text segments separated by tool calls retain spacing, so exact-text expectations may need updating.
Forwarded request bodies stream into sub-agents instead of being buffered in the parent; handlers needing the complete upload must consume or stream request.body before returning.
Screenshot output is reduced to the compact model-facing summary rather than returning raw base64 data.
Replaces textDeltaFromStreamChunk() for messenger integrations; pass the complete structured stream events.
Observer error frames are terminal responses and clear streaming, replay, recovery, and tool-continuation state, even without done.
Provides the single AI SDK v6 and v7 tracing integration, replacing the separate callback adapter.
New APIs and options 3
Adds connection-scoped Kitesurf support to Browser Tools through the browser session option.
Constructs canonical root-first Agent and sub-agent addresses for external HTTP requests, WebSocket connections, callbacks, and webhooks.
Exposes WebSocketChatTransport and its connection types from the framework-neutral agents/chat/transport entry point.
Behavior and default changes 2
Accepts AI SDK FlexibleSchema inputs, including Valibot adapters, while preserving schema-driven input inference and structured output validation.
React peers are optional for framework-neutral clients and servers; React entry point users must still declare compatible dependencies explicitly.
Tooling 1
New Think projects use Workers Types v5 with matching Wrangler and Vite plugin versions.
agents 0.2024 changes
Breaking changes 5
On AI SDK v7, chat and execute_tool spans are nested under invoke_agent, and tool_approval segments are nested under execute_tool.
Becomes an optional peer; applications importing agents/skills or agents/browser must install Codemode explicitly, while MCP-only applications no longer install it transitively.
Storage preserves stateless discovery data and RPC restoration details; older stored HTTP session IDs are discarded and reconnect instead of being resumed unsafely.
The Workers handler rejects malformed, opaque, and non-HTTP browser Origins and applies matching Host checks to localhost and workers.dev endpoints.
The legacy compatibility fallback returns 405 without constructing an application server for session-only GET and DELETE requests.
Deprecations 3
The explicit result-schema overloads are deprecated; use callTool(params, options) or callTool(confirm, params, options) instead.
Passing an SDK v1 server is deprecated for removal in the next major release; migrate to an SDK v2 factory or temporarily use createLegacyMcpHandler.
Deprecated and feature-frozen as a stateful SDK v1 path; new servers should use an SDK v2 factory with createMcpHandler.
New APIs and options 6
AI SDK v7 identity and turn context are supplied through runtimeContext and telemetry.includeRuntimeContext; reserved keys map to existing v6 attributes and other included keys pass through under a Cloudflare namespace.
Adds an entry point exporting the stateless Agents handler without retaining McpAgent, WorkerTransport, client transports, PartyServer, or SDK v1 modules.
Allows custom-domain deployments with wildcard CORS to explicitly configure allowed hostnames.
Allows explicit origin-hostname configuration, including
*when trusted upstream middleware enforces the required Origin policy.Provides an explicit public API for SDK v1 servers and complete WorkerTransport options.
Accepts an SDK v2 factory returning McpServer or Server, serving stateless MCP with legacy compatibility by default.
Behavior and default changes 5
SDK-backed SSE transports now own keepalives, so each stream has one timer; the legacy McpAgent WebSocket bridge retains its Agents-owned keepalive.
Default CORS preflights allow the stateless MCP-Method and MCP-Name request headers.
MCPClientConnection supports SDK v2, probing for stateless MCP before falling back to the legacy initialize handshake on the same connection.
After token issuance, redirect-scoped discovery is discarded while discovery-triggered authentication is preserved, allowing a changed authorization server to be rediscovered without reusing prior issuer credentials.
The SDK automatically fulfills stateless elicitation input_required results through existing form and URL handlers while tool, prompt, and resource calls remain pending.
Fixes and other changes 5
Telemetry spans now retain token counts, finish reasons, tool results, durations, and usage reported before a turn fails or is cancelled.
A chat turn now owns its own span boundary, so an unawaited turn is not cut short by the handler that started it.
Spans still open when their invocation ends are closed and marked truncated rather than being treated as complete.
generateText telemetry is now bounded on the same terms as streamText.
Reusable sessions are recycled after the platform reports HTTP 410 for an expired session.
agents 0.195 changes
Breaking changes 2
The callback type changes from StreamTextOnFinishCallback to GenerateTextOnFinishCallback.
Tool-execution-finished events from AI SDK v6 and v7 are normalized to one context; stepNumber is undefined under v7.
New APIs and options 1
@cloudflare/think accepts TurnConfig.telemetry and forwards it ahead of experimental_telemetry when present.
Behavior and default changes 2
agents, @cloudflare/ai-chat, @cloudflare/codemode, and @cloudflare/think accept AI SDK v6 or v7, so consumers can adopt v7 without a forced upgrade.
Its emitted file-data model output is accepted by both AI SDK majors.
agents 0.186 changes
Breaking changes 1
The agents/vite turndown stub now fails with a diagnostic when called by app code; applications that use turndown themselves can opt out with
stubTurndown: false.
Security 1
OAuth callback state is verified before a connection changes, preventing forged, expired, or replayed callbacks from disrupting authorization; addMcpServer() refreshes auth URLs with expired state.
New APIs and options 1
Adds AI SDK v6 and v7 telemetry integrations that project Cloudflare-native spans and GenAI attributes; message and tool payload storage is opt-in.
Behavior and default changes 1
SDK-managed initialization, startup, chat interactions, turns, and durable submissions are grouped into named tracing phases with agent identity and operation-specific metadata; runtimes without the tracing API are unaffected.
Fixes and other changes 2
Recovery now honors retry budgets for resolved connection failures, finishes in-flight restore work before stable-id migration, and closes connections replaced by the legacy connect() path.
When a server rejects a persisted session with HTTP 404, the client clears the stale session, initializes a new one, and rediscovers capabilities once.
agents 0.1740 changes
Breaking changes 3
Connections advertise only elicitation modes with configured handlers; without handlers they advertise no elicitation capability. An explicit capability declaration remains authoritative.
AgentClient, useAgent, and useAgentChat expose terminal connection failures; terminal WebSocket close events no longer trigger reconnection.
Moves just-bash from a runtime dependency to an optional peer dependency, so applications only install it when using the skills bash runner.
New APIs and options 24
Agents can configure form and URL elicitation handlers to respond to server-initiated elicitation requests; configured modes are re-advertised after Durable Object hibernation.
Adds an observability event emitted when an alarm encounters a memory-limit reset.
Adds a per-incident retry budget for memory-limit resets during chat recovery. After the default three retries, recovery seals with reason out_of_memory.
Exports a predicate that recognizes Durable Object memory-limit resets, including errors containing the shared “exceeded its memory limit” fragment.
Adds a strike limit for alarm-boundary memory resets; after the default three strikes, recovery is sealed and only looping schedule rows are purged.
The diagnostics event union adds typed action-ledger and durable-pause action approval events.
Think channel and notice observability events route to a dedicated diagnostics channel and are accessible through the typed channel subscription API.
Adds a shared chat entry point with useAgentChat, chat transport helpers, and shared chat wire types.
Run state exposes persisted, replayable milestones, deduped by sequence.
Cancel a detached or awaited run by id through the guarded lifecycle path.
Adds a server-to-client frame that keeps resume requests waiting when a turn is accepted but its stream has not started.
Adds an observability event for Think turn execution.
Adds an optional attachments field to support the Think actions reply-attachment side-channel.
Set a per-run silence budget for detached children that have reported progress; exceeding it surfaces an interrupted run with the no-progress reason.
Chat agents can configure milestone names to produce synthetic messages in narrate or react mode.
Configure the absolute time ceiling for detached runs; runs that exceed it are interrupted with the budget-exceeded reason.
Override the wording of synthetic detached milestone messages.
A parent hook receives progress updates from awaited and detached runs, best-effort from the tail.
Adds a generic chat-recovery message-store interface for orphan-persist writes.
Adds a shared export for merging reconstructed orphan stream partials without duplicating tool calls or overwriting stored tool results.
Adds a type for Think actions reply attachments.
Chat agents can report progress during agent-tool runs; signals can include fraction, message, phase, data, and a durable milestone.
Dispatch a sub-agent as a detached background run without blocking the calling turn, optionally configuring a durable completion callback and budget.
Hosts with server-authoritative transcript storage can use syncMessagesToServer while keeping setMessages local-only.
Behavior and default changes 5
MCP client connections now use the Worker-safe CfWorkerJsonSchemaValidator by default, including connections created through the RPC path. Caller-supplied validators remain effective on the live connection.
Defaults to a finite backstop of 1000 instead of Infinity, allowing recovery to seal runaway turns with reason work_budget_exceeded.
The ai peer dependency is optional for the root agents runtime; AI-specific entry points still require it when imported.
Run inspection exposes the latest persisted progress snapshot so a rehydrated parent can reconstruct progress after eviction.
Think actions gain stable approval descriptors, and approval descriptor metadata is preserved on chat tool parts.
Fixes and other changes 8
For restored HTTP MCP connections still authenticating, addMcpServer returns an available authorization URL or reconnects and verifies the result instead of incorrectly reporting ready.
Persisted capability seeds are consumed only after a seeded handshake completes, so interrupted restores do not lose elicitation modes before they can be re-advertised.
Intercepts Durable Object memory-limit resets at the outermost alarm frame, preventing endless platform alarm retries; other errors are re-thrown as before.
Server-to-client requests can be sent from callbacks that do not inherit the agent's async context, including callbacks reached through Worker Loader RPC.
Replayed approval requests no longer overwrite an approval decision or cause the client to show Approve/Reject again.
Denied-output chunks no longer overwrite settled or user-approved tool parts, or regress client state through replay and broadcast.
Approval updates synthesize a stable provider-facing approval id from toolCallId when older or hand-seeded transcripts lack approval.id.
Re-probes the stream on transparent socket reopen and preserves authoritative message order when a snapshot already includes a newer assistant message.
agents 0.1641 changes
Breaking changes 7
Browser Quick Actions require a Worker compatibility date of 2026-03-24 or later and remote: true on the browser binding for local wrangler dev.
The browser tool surface is now a single durable tool that runs sandboxed code against a CDP connector, replacing several flat tools.
The previous browser_search and flat-tool surface is removed in favor of browser_execute.
Worker entries must export this facet class from agents/browser to support the browser runtime.
The previous browser provider API is removed.
The AI SDK and TanStack AI variants now require the hosting Durable Object's ctx and return browser_execute.
Non-streaming calls now time out after 30 seconds by default; per-call timeout: 0 opts out.
New APIs and options 19
Live View types are exported from agents/browser for use with browser session Live View APIs.
Adds stateless Quick Action primitives for one-shot browsing through a browser binding, including Markdown, extraction, links, scraping, content, snapshots, screenshots, and PDFs.
Adds AI SDK tools for one-shot browsing with a browser binding, including Markdown reading, structured extraction, and element listing or scraping.
Fetches a finished browser recording through the Browser Rendering REST API, returning per-tab rrweb event arrays ready for rrweb-player.
The cdp connector adds a tool that returns a link for a human to watch and control a browser session in real time.
BrowserConnector exposes a host-side helper for surfacing shared-session Live View URLs; targets include the tab's current pageUrl.
Adds an internal API used by the MCP handler to schedule destruction without aborting the isolate.
Browser executions use a CDP connector with methods including send, attachToTarget, spec, and getDebugLog.
Adds clientTools and onClientToolCall for exposing client-defined tools and completing their round trip within a Think sub-agent chat turn.
Exports a type for client tool executors.
Exposes the runtime handle and connector for host-side wiring, including approvals and session management.
Accepts an optional execute delegate to build the executable variant of client-schema tools.
Adds an exported cause-aware classifier for platform transient errors, including reset, retryable, and network-connection-lost errors.
Adds a chat tool-part update that replaces a paused execution's transcript output with its resolved outcome.
Adds replayErroredChunksByRequestId, cleanup(now?), and hasReclaimableStreams for replaying errored content and supporting alarm-driven cleanup.
Returns per-row stored sizes and roles for the active path without loading message content.
Reads the most recent active-path messages that fit a byte budget and reports truncation and total content bytes.
Adds a maintenance write path that avoids the full-history token-estimate status broadcast of updateMessage.
Adds a per-client default timeout for non-streaming RPC calls; 0 disables it. Streaming calls are exempt.
Performance 2
Caches the active branch tip so latest-leaf lookups on hydration and append are typically O(1) instead of scanning every message row.
Reduces SQLite reads during normal wakes and text-only turns by delaying automatic media-eviction scans and avoiding per-wake metadata-column introspection.
Behavior and default changes 7
Browser Quick Action tools are now exposed by default alongside browser_execute when a browser binding is present; pass quickActions: false to opt out.
Browser tools resolve ctx from the current Agent, so ctx no longer needs to be passed explicitly from inside an Agent.
Props containing non-ASCII characters are base64-encoded in the header and decoded on the server; older raw-JSON values remain accepted.
MCP session deletion schedules teardown through the agent's alarm so destruction can finish with a fresh execution budget.
Follow-up alarms resume recovery when work remains, with exponential backoff when scans make no progress.
AIChatAgent and Think arm cleanup alarms when streams start and finish; completed or errored buffers are retained for 10 minutes and abandoned streams for 1 hour.
RPC calls route through the live socket, queue until it opens, and reject transmitted calls if their socket closes or is replaced.
Fixes and other changes 6
Detaches the previous transport before reconnecting, allowing re-authorization after a mid-session 401.
OAuth now finishes on the transport that received the 401, preserving resource metadata and supporting authorization servers with non-default token paths.
Accepted WebSocket connections are pinned to arraybuffer so binary frames retain the Agent protocol's historical contract, regardless of compatibility date.
Client tool schemas and executors passed through Think chat are kept per-turn and are not persisted, so recovery does not mistake interrupted calls for pending human interaction.
Responses for async calls that finish after client disconnect are now ignored instead of raising a WebSocket send-after-close error.
Fallback-ACKs each resume offer at most once per socket and resets the matching assistant message on replay, preventing duplicated streamed text.
agents 0.156 changes
Breaking changes 5
The second argument now uses the SDK shape, { parsedBody?, authInfo? }; direct callers must wrap parsedBody in an object.
It now fires on client and protocol validation failures, including responses such as 400/405/406/415 and session-not-found.
On DELETE, it fires before the underlying close() and therefore before onclose; the session id is still passed.
It now affects only the SDK priming event, which is emitted under the SDK's event-store, protocol-version, and stream conditions.
It is now a read-only getter backed by the SDK's internal _started flag; assigning to it is no longer supported.
Fixes and other changes 1
It now forwards SDK transport options, including eventStore, retryInterval, onsessionclosed, and DNS-rebinding options, instead of silently dropping them.
agents 0.1472 changes
Breaking changes 8
Skill scripts must be compiled to self-contained JavaScript before runtime; scripts that still need compiling now throw a clear error instead of being bundled in-Worker.
The option has been removed because the in-Worker bundler is no longer used.
The Vite plugin now stubs turndown by default to avoid a Worker startup error; set stubTurndown: false to opt out when using turndown directly.
The reason field gains work_budget_exceeded and recovery_aborted; max_recovery_window_exceeded remains an open-string value but is no longer emitted.
Removes the non-resetting wall-clock ceiling for progressing turns, so they can survive unbounded deploy churn; stuck turns remain bounded by the no-progress window and attempt cap.
On a facet sub-agent, returns only virtual sub-agent connections instead of accessing the root Durable Object's WebSockets, preventing cross-DO native I/O crashes.
Finalized tool input is normalized at the chat write boundary: objects pass through, JSON object strings are parsed, and other values become {}.
Returns a structured failure envelope with status and retryable fields, allowing callers to distinguish interrupted runs from aborted or failed runs.
Security 2
Scaffolds a minimal Workers/Vite Think app, handles target directories, refuses unsafe migrations, and installs npm dependencies by default.
Pending PKCE verifiers are bound to OAuth callback state, preventing overlapping authorization attempts from exchanging a code with another attempt's verifier.
Deprecations 1
Logs a one-time warning when chatRecovery is reassigned in onStart(), because recovery has already evaluated its configuration; assign it as a class field or in the constructor.
New APIs and options 42
Exports a helper for compiling skill scripts before uploading them from R2 or other dynamic sources.
Adds a manifest-driven Vite framework layer that discovers agents in agents/, generates Worker entrypoints and virtual modules, and supports routing, skills, and Worker config defaults.
Exposes manifest and config diagnostics in text or JSON.
Generates Think-owned declarations and can optionally compose with Wrangler type generation.
A shared helper is exported from
agents/chatfor buildingINclause strings.A shared helper is exported from
agents/chatto represent the maximum number of bound parameters.Adds a machine-readable reason type for interrupted agent-tool results so callers can distinguish why a run was abandoned.
Adds a public hard wall-clock ceiling for child re-attachment; it defaults to Infinity, with a finite value enabling a cap.
Adds a public AgentStaticOptions setting for the progress-keyed no-progress budget when re-attaching to an agent-tool child; defaults to 120000.
Adds an observability event emitted once when proactive or reactive context compaction occurs.
Adds the classification type used to label chat errors, including context overflow, rate limits, transient, fatal, and unknown errors.
Adds the error classification to ChatErrorContext so it is available to onChatError and observers.
Adds a public type for the context passed to the chat-recovery progress predicate.
Interrupted results now report whether the child is still running, allowing callers to branch without inspecting human-readable error text.
Lets an app classify raw or in-stream chat errors into provider-agnostic categories for context-overflow recovery and error observers.
Bounds retries for reactive context-overflow recovery.
Adds a pre-step guard that compacts history when reported input-token usage crosses a configured threshold, helping avoid provider context-window errors.
Exports a bundled classifier for common provider context-overflow errors for apps that do not need custom classification.
Caps produced content and tool units during a chat-recovery incident; exceeding the budget seals the incident with work_budget_exceeded. Defaults to Infinity.
Makes the no-progress timeout configurable per agent; it resets on progress and defaults to five minutes.
Adds a predicate consulted from the second recovery attempt onward; returning false seals the incident with recovery_aborted.
A helper is exported from agents/chat to normalize tool input, allowing read-side transcript repair to enforce the same object invariant.
Adds an optional caller-supplied server ID to HTTP and RPC overloads, enabling stable server identifiers in storage, restored connections, tools, and OAuth state.
Adds a framework-agnostic Agent Skills engine with skill sources, a registry, activation tools, binary-safe resource reads, and qualified cross-skill paths.
Adds a Vite plugin specifier for importing bundled skills, defaulting to a ./skills directory.
Adds an exported type for agent-tool failures, including status and retryability information.
Adds a protocol frame broadcast during durable chat recovery and cleared on terminal outcomes so clients can show that a turn is recovering.
Adds recovery observability events that can be routed to an analytics sink.
Adds configurable chat recovery defaults and terminal exhaustion behavior; Think recovery exhausts after six failed attempts by default.
Adds a stable request ID for the whole continuation chain, useful for per-incident budget tracking and fresh-incident detection.
Adds incident identity, terminal text, partial turn output, and stream metadata to the onExhausted payload for rendering terminal UX and correlated telemetry.
Adds an opt-in inactivity watchdog that aborts a turn with a terminal stream error when no UI-message-stream chunk arrives within the configured window; off by default.
Adds an optional CompactContext second argument, allowing the Session token counter to guide the compaction boundary as well as the trigger.
Exports a shared replay-safe builder for cross-message tool results with first-write-wins idempotency.
Exports a Durable Object-backed event store for wiring resumability into WorkerTransport, with timestamped events and a sweep method.
Bounds generic unmanaged fiber recovery so a repeatedly throwing onFiberRecovered() hook cannot retrigger forever across restarts.
@cloudflare/think wires getSkills() into the turn, while other AI SDK callers can build a SkillRegistry directly.
Exports a helper that normalizes supplied MCP server IDs for use in tool names and storage keys.
Surfaces Think post-persist chat request failures through an onChatError hook.
Adds optional experimental script execution for function-style JavaScript/TypeScript and path-based Python and Bash behind a capability and permission bridge.
Adds ThinkWorkflow with durable step.prompt() support for Workflow-owned Think reasoning steps.
Exposes an isRecovering flag distinct from isStreaming so clients can show a busy state before tokens resume.
Performance 4
Stale incidents are deleted in batches, avoiding a separate awaited storage deletion for each incident.
Terminal submissions are deleted in batches rather than one at a time.
Stale-row pruning and
maxPersistedMessagesenforcement use batched deletes instead of one delete per row.Buffered stream chunks are packed into SQLite rows, reducing rows written, stored, and scanned during replay; reads still support packed and legacy rows.
Behavior and default changes 1
MCP transports use resumability when an EventStore is configured; standalone GET streams otherwise retain a comment-frame keepalive, while POST streams always keepalive.
Fixes and other changes 14
Orphan recovery uses the persisted assistant message id when provider chunks lack one, preventing a new turn from merging into the previous assistant message while preserving continuation behavior.
Durable continuation recovery skips reconstructed parts for tool calls already present on the message, avoiding duplicate parts for the same tool call.
Recovery reruns an interrupted new turn when the conversation leaf is still the user message, rather than continuing by cloning and merging into the previous assistant message.
Interrupted causes and child-running status are persisted across reconnect replay and cleared when an interrupted row is repaired to completed or error.
Enables bounded recovery from classified context-overflow errors by discarding the truncated partial, compacting the session, and retrying from compacted history.
Parent recovery now follows a still-running child using a progress-keyed no-progress budget, allowing healthy streaming children to reach terminal state instead of being abandoned at a flat 120-second limit.
Workflows using ThinkWorkflow.prompt() now release their RPC stubs promptly, preventing resource leaks and associated warnings.
Workflows using waitForApproval() now release their RPC stubs promptly, preventing resource leaks and associated warnings.
One-shot scheduled work is preserved and re-run on a fresh isolate when either recognized superseded-script error occurs, preventing queued work from being abandoned.
Prevents result responses from crossing concurrent POST streams with duplicate in-flight JSON-RPC request IDs, returning internal errors when the origin cannot be disambiguated.
Tightens SSE resumability: final responses remain replayable while streams are open, POST events are stored without a live connection, and each message is routed to one stream.
Fixes approved server-side tool continuations getting stuck by preserving terminal tool parts, updating the live transcript, and consistently labelling continuation frames.
When a one-shot schedule encounters a transient Durable Object reset after a deploy, it rethrows so the row survives and the alarm can resume on a fresh isolate.
Preserves all resolved terminal tool states when reconciling stale client messages, including output-error and output-denied.
agents 0.1321 changes
Breaking changes 2
Programmatic chat turns now return error statuses for in-band stream errors.
Session APIs now consistently return promises, giving callers the same surface with local SQLite or external storage providers.
New APIs and options 11
An error callback is exposed for auto-compaction.
Session auto-compaction supports custom token counters.
Adds a package entrypoint for a Chat SDK StateAdapter backed by Agents sub-agents.
Adds the concrete Chat SDK state adapter, which stores state in Durable Object SQLite and shards it through parent.subAgent().
Adds the default sub-agent used for durable Chat SDK state.
Adds a convenience factory for Chat SDK state; it defaults the parent from getCurrentAgent() in an Agent lifecycle method or request handler and works with the default ChatSdkStateAgent when re-exported from the Worker entrypoint.
Adds a default key sharding helper for the adapter.
Adds a default thread sharding helper for the adapter.
Adds managed fiber jobs with idempotent acceptance, optional completion waiting, inspection, cancellation, explicit recovery outcomes, and retained terminal status records.
Accepts an optional relatedRequestId forwarded to the transport so elicitation routes through the originating POST response stream; tool handlers can pass extra.requestId.
Experimental Postgres-backed session, context, and search providers enable external session storage via Hyperdrive-compatible pg clients.
Behavior and default changes 1
Newly created sub-agents use path-scoped identities, while existing registry entries retain legacy bare-name identities.
Fixes and other changes 7
Generated workflow instance IDs now satisfy the Workflows runtime ID validator.
Facet startup no longer self-deadlocks when same-name sub-agents hydrate WebSocket connection state after wake.
Pre-stream interruptions now automatically retry the existing unanswered user message when it is safe to do so.
Auto-compaction estimates now include the Session-managed frozen system prompt, improving estimate accuracy.
Fixes nested sub-agent bootstrap so facet parents do not need to be bound as top-level Durable Object namespaces.
Can resolve facet-only direct parents through a root RPC bridge.
Reverts routing related server-to-client MCP messages over the originating POST response when no standalone SSE stream is open.
agents 0.1223 changes
Breaking changes 2
The minimum internal peer dependency versions were raised to versions at least as recent as the current repo packages.
The deprecated synchronous API now throws inside sub-agents; use the async alternatives instead.
New APIs and options 6
Exposes routingRetry configuration through getAgentByName.
Define retained, streaming Think and AIChatAgent sub-agent tools for a parent agent.
Use headless helpers for React/client event state in agent tool orchestration.
Parent agents can replay and clean up sub-agent runs.
Run Think and AIChatAgent sub-agents as retained, streaming tools from a parent agent.
Use Think and AIChatAgent as child adapters for agent tool orchestration.
Behavior and default changes 1
Sub-agents can use schedule(), scheduleEvery(), cancelSchedule(), getScheduleById(), listSchedules(), keepAlive(), keepAliveWhile(), runFiber(), and Think chat recovery through the parent-owned Durable Object alarm.
Fixes and other changes 14
Duplicate initial state frames are prevented so client-originated state updates are not overwritten by stale initial state messages.
Resume negotiation and replay no longer throw when they race with a closed WebSocket connection.
Recovery after Durable Object restarts defers user finish hooks until agent startup and isolates hook failures, preventing client state drift and blocked finalization.
Think's workspace read tool replays legacy raw-string outputs as text instead of stalling subsequent turns.
Requests are routed through the originating POST stream when no standalone SSE stream is available.
Structured tool output shapes are preserved when truncating older messages or oversized persisted rows, preventing custom handlers from crashing or mis-replaying compacted results.
Stale schedule rows are pruned when their owning facet registry entry no longer exists.
Typed support for streaming callable methods is fixed.
Drill-in chat connections no longer miss the terminal stream frame when the helper completes between the resume notification and client acknowledgement.
Partially hydrated assistant responses are rebuilt from replay chunks instead of rendering replayed text as a second assistant text part.
Deployed Workers keep the browser WebSocket owned by the parent Agent and forward connect, message, and close events to child facets over RPC.
Request, WebSocket, and email native context handles are cleared when switching Agent instances.
Destroying a sub-agent delegates cleanup through the parent so parent-owned schedules and descendant fiber recovery leases are removed consistently.
Schedules are scoped to the calling child, preventing sibling sub-agents from canceling each other's schedules by id.
agents 0.1137 changes
Breaking changes 6
The peer dependency floor is now >=0.5.2, so pairing agents with an older version produces a peer warning.
The peer dependency floor is now >=0.3.4, so pairing agents with an older version produces a peer warning.
Calling subAgent from a parent class that is not bound as a Durable Object namespace now throws a descriptive error pointing to wrangler.jsonc.
Inside a sub-agent, this.name now reports the sub-agent’s own name instead of the parent’s name.
Sub-agent classes named "Sub" are rejected because the /sub/ URL separator is reserved.
Calls to broadcast on facets now no-op, preventing broadcasts from reaching into the parent Durable Object's WebSocket registry.
Security 1
The MCP client now blocks the full IPv6 link-local range fe80::/10 in its SSRF check, including addresses from fe81:: through febf::.
New APIs and options 20
Exported from
agents/chatso stream broadcasters can detect and skip replayed tool-call chunks.Accepts an optional cancellation reason that flows through to signal.reason on the cancelled controller.
Connects an external AbortSignal to a per-request abort controller so callers can cancel a chat turn without knowing its internally generated request id.
Exposes SaveMessagesOptions from agents/chat for use by typed APIs.
agents/chat now exports a controller for the latest, merge, drop, and debounce submit-admission state machine.
AIChatAgent now accepts a Props generic extending Agent<Env, State, Props>, so subclasses get properly typed this.ctx.props.
Adds typed RPC access to a named sub-agent through its parent; the returned Proxy is RPC-only and does not support .fetch().
Adds parent-side sub-agent registry introspection, accepting a class constructor or CamelCase class name string.
Adds an overridable middleware hook for sub-agent requests that can short-circuit, mutate the request, or pass it through; the default is permissive.
Adds a root-first ancestor chain populated when a facet initializes, including recursively nested facets.
Adds a public parser for sub-agent URLs, used internally by the routers.
Adds a sub-agent counterpart to routeAgentRequest for custom-routing setups whose outer URL does not match the default /agents/... shape.
Clients can address a child Durable Object facet directly through a nested URL under its parent agent.
Exposes the fixed "sub" URL separator constant for symbolic URL building; it is not configurable.
Adds a flat root-first sub-agent chain option for addressing descendant facets; .agent and .name identify the leaf, while .path exposes the full chain.
Adds an experimental adapter that bridges MCP server tools to Chrome's native navigator.modelContext API, allowing browser-native AI agents to discover and call tools registered on a Cloudflare McpAgent.
Adds the underlying fiber's start time in epoch milliseconds to chat recovery contexts, allowing apps to suppress continuations for stale, interrupted turns.
Adds the run start time in epoch milliseconds to fiber recovery contexts, allowing apps to suppress continuations for stale, interrupted turns.
Adds an Agent class method for sending outbound email via Cloudflare Email Service, with agent routing headers and optional HMAC signing for secure reply routing.
Experimental browser CDP tools use the live Browser Rendering protocol instead of bundling the spec.
Behavior and default changes 2
The status union now includes "aborted", so turns cancelled via the new signal API surface as aborted rather than completed.
The experimental compatibility flag is no longer required for sub-agent features or Think; remove it if it was only enabled for these features.
Fixes and other changes 8
Repeated tool-call chunks no longer create duplicate parts or overwrite resolved input and state.
The peer dependency is now ^0.5.4; this version restores the __ps_name fallback for fresh 0.5.x Durable Objects on older compatibility dates when they wake from alarms.
Overlapping submits are protected while an accepted request is between admission and turn queue registration; stale turns are also prevented after a clear in that interval.
Think now reconciles incoming assistant messages before persistence, preventing duplicate orphan assistant rows when a user submits during a streaming tool turn.
This shared lifecycle type now lives in agents/chat and is re-exported by @cloudflare/ai-chat and @cloudflare/think.
Deletion is now idempotent: deleting a child that was never spawned or was already deleted no longer throws.
Fixes the MCP client to capture a tool's title.
Fixes cross-Durable-Object I/O errors on first use by initializing facets in the child isolate before its first onStart().
agents 0.1045 changes
Breaking changes 8
Removed; use the maxSteps property instead.
Now a property with default 10 instead of a method; override it per turn via TurnConfig.maxSteps.
Removed; use lifecycle hooks instead, or extend Agent directly for full custom inference.
The experimental forever export has been removed from both packages.
Think no longer exposes a fibers flag; recovery is automatic via alarm housekeeping.
Think now extends Agent directly, inherits fiber support, and wraps onStart so subclasses do not need to call super.onStart().
The experimental mixin has been removed.
The experimental mixin has been removed; fiber support is inherited from Agent.
Security 1
Adds a hook for redacting PII before message persistence.
New APIs and options 27
New lifecycle hook that fires on every turn from all entry paths.
New lifecycle hook receives the assembled system prompt, messages, tools, and model; return a TurnConfig to override them.
Extension manifests now support namespaced context block declarations.
Extension manifests now support a hooks field.
Adds context blocks after session initialization.
Removes context blocks after session initialization.
Adds an export used for fiber recovery.
Returns composed system content and messages from context blocks.
Adds the context type used by the onChatRecovery hook.
Think can override session configuration for context blocks, compaction, search, and synchronous or asynchronous skills.
Adds a continuation flag to OnChatMessageOptions.
Extends the last assistant response and appends seamlessly to an interrupted assistant message.
Adds an export for retrieving agent messages.
Adds getHttpUrl to the useAgent return value.
Adds a way to detect pending interactions.
Optional filter parameter scopes MCP tool, prompt, resource, and resource-template results by server ID, name, or connection state.
Adds queue, latest, merge, drop, and debounce message concurrency strategies.
Provides provider-specific recovery for interrupted chat turns.
Adds a lifecycle hook that fires from all turn paths.
Provides recovery handling for fibers after Durable Object eviction.
Adds non-destructive regeneration using Session branching.
Exposes resetTurnState as a protected method.
Registers work in SQLite, holds a keepAlive ref, and enables recovery after Durable Object eviction.
Enables programmatic turn entry for scheduled responses, webhooks, and proactive agents.
Checkpoint progress so it survives eviction.
When enabled, wraps each AIChatAgent chat turn in a fiber for recovery.
Adds a way to wait for quiescence.
Behavior and default changes 4
MCP tools are automatically merged, so manually merging this.mcp.getAITools() in getTools() is no longer needed.
Custom body data now persists across hibernation.
Recovery now runs eagerly in onStart, detecting interrupted fibers on the first request after wake; the alarm remains a fallback.
Think now re-exports Session and uses it to back messages with history, tree-structured messages, context blocks, compaction, and FTS5 search.
Tooling 1
The peer dependency range is capped below version 9 to avoid silently accepting untested future major versions.
Fixes and other changes 4
Reasoning chunks now persist providerMetadata, preserving Anthropic thinking block signatures so extended thinking can continue across turns.
Initializes the Durable Object after hibernation via native DO RPC before processing messages, hydrating this.name and running onStart().
Closing connections explicitly terminates active sessions, and session IDs persist across reconnects and restores.
Fixes the target Durable Object remaining non-hibernatable for roughly 100–120 seconds after onEmail returns.
agents 0.93 changes
New APIs and options 2
Adds a pure state machine to agents/chat for managing StreamAccumulator lifecycle during broadcast and resume streams.
Adds a shared serial async queue with generation-based invalidation for chat turn scheduling.
Fixes and other changes 1
Think now serializes chat turns, preventing concurrent turns from interleaving, and gains deferred continuations, resume coordination, onClose cleanup, and hibernation persistence for client tools.
agents 0.820 changes
Breaking changes 3
The agents core no longer has the ai runtime dependency; MCP tool schema conversion uses Zod 4 instead.
AgentClient.call is assigned per instance rather than existing on the prototype; normal calls are unaffected, but prototype reflection and subclasses overriding it may need adjustment.
The peer dependency range no longer includes Zod v3 and now requires zod ^4.0.0.
New APIs and options 8
Adds transport: "auto" to serve Streamable HTTP and legacy SSE on the same endpoint, selecting Streamable HTTP for capable clients while supporting older SSE-only clients.
MCP RequestInfo now includes the request URL, including query parameters, so tool handlers can access them.
An optional agent type parameter enables inference for RPC method names, arguments, return values, and state; the previous AgentClient<State> pattern remains supported.
RPC type utilities including AgentMethods, AgentStub, and RPCMethods are exported for consumers needing advanced typing.
A hook called on every alarm cycle lets extensions such as the fiber mixin run housekeeping without coupling it to the scheduling system.
schedule() supports idempotency for delayed and Date schedules; cron schedules are idempotent by default, and
{ idempotent: false }overrides that default.useAgent and AgentClient expose a readable state property; useAgent is reactive, and state starts as undefined until populated by the server or setState().
AgentClient adds a stub proxy for calling agent methods using RPC-style property access.
Behavior and default changes 4
When called from a @callable method over WebSocket, callbackHost is automatically derived from connection.uri, so addMcpServer can be called without extra options.
keepAlive() uses an in-memory reference count and shares one alarm cycle among concurrent callers instead of creating schedule rows and schedule observability events.
The @experimental annotation is removed from keepAlive() and keepAliveWhile().
schedule() in onStart() without
{ idempotent: true }warns once per callback; alarm() also warns and emits a diagnostics event when processing at least 10 stale one-shot rows for the same callback.
Tooling 3
A shared TypeScript configuration is now exported for use by examples and internal projects.
A Vite plugin is now exported; it handles TC39 decorator transforms for
@callable()until Oxc lands native support.Workflow instance methods pause(), resume(), restart(), and terminate() are supported in wrangler dev, so local development workarounds were removed.
Fixes and other changes 2
Fixes elicitInput() hanging on RPC transport by intercepting elicitation responses in handleMcpMessage().
A malformed schedule row or warning emission failure can no longer break processing of the remaining schedule rows.
agents 0.750 changes
Breaking changes 9
The export was removed; import Workspace from @cloudflare/shell instead.
The experimental mixin is replaced by sub-agent methods on the Agent base class.
Combined union types are split so each event has its own discriminant for type narrowing; new error event types are added.
BaseEvent no longer includes id or displayMessage; events contain type, payload, and timestamp, and payload fields are strictly typed.
The one-time warning about Authorization in Access-Control-Allow-Headers with wildcard origin is removed.
Observability.emit() no longer accepts an optional ctx second parameter; custom implementations should accept only the event.
The default implementation stops logging every event to the console and publishes events to named diagnostics channels instead.
MCP client connections now block private and internal IP addresses, including loopback, link-local, cloud metadata, and IPv6 local ranges.
SQL failures are wrapped in SqlError and thrown directly rather than routed through onError, making them catchable with try/catch.
Security 2
OAuth state parameter values are removed from warning logs to prevent sensitive data leakage.
Error strings are sanitized by stripping control characters and truncating to 500 characters before broadcasting to clients.
New APIs and options 22
Adds a getter to the Agent base class that returns the Durable Object ID for Workers AI prefix-cache optimization and routing requests from the same agent to the same backend replica.
Adds abortSubAgent() directly to the Agent base class as part of the sub-agent facet API.
The Workspace class can be imported from agents/workspace.
Adds deleteSubAgent() directly to the Agent base class as part of the sub-agent facet API.
Adds subAgent() directly to the Agent base class as part of the sub-agent facet API.
Adds a Workspace class for durable file storage for any Agent, with a hybrid SQLite+R2 backend and optional just-bash shell execution.
Adds a cwd option to bash().
Adds multi-step shell workflows with persistent cwd and env across exec calls.
Adds durable file storage for any Agent with a hybrid SQLite+R2 backend; import from agents/experimental/workspace.
Observability events now include the agent class that emitted each event.
Adds a new email channel.
Adds an observability event for WebSocket close.
Adds an email receive observability event.
Adds an email reply observability event.
Observability events now include the agent instance that emitted each event.
Adds a queue create observability event.
Adds an experimental Agent method that keeps the Durable Object alive using 30-second alarm heartbeats and returns a disposer.
Adds an experimental Agent method that runs an async function and automatically cleans up its heartbeat when the function completes.
Adds a method that awaits in-flight connection, discovery, and tracked background restore operations, with an optional timeout in milliseconds.
Adds a static options setting to opt out of sending the instance name to clients with custom routing, or set it true to silence the warning.
A typed subscribe helper is exported from agents/observability, providing event type narrowing per channel.
Adds an opt-in AIChatAgent setting to wait for MCP connections indefinitely or up to a timeout; it defaults to false.
Behavior and default changes 4
HTTP transport deduplication now matches on both server name and URL, allowing different URLs with the same name to create separate connections; RPC transport still deduplicates by name.
AIChatAgent now automatically keeps the Durable Object alive while streaming replies, preventing idle eviction during long LLM generations.
McpAgent suppresses CF_AGENT_IDENTITY, CF_AGENT_STATE, and CF_AGENT_MCP_SERVERS frames on MCP transport connections; regular WebSocket connections are unaffected.
In production, diagnostics channel messages are automatically forwarded to Tail Workers without requiring a subscription in the agent.
Fixes and other changes 13
Restores lost Durable Object alarms when an existing interval schedule is reused after restart.
State persistence uses a single row with a row-existence check, correctly handling falsy values such as null, 0, false, and the empty string.
MCP clients can connect to localhost and loopback URLs for local development; private, link-local, and metadata endpoints remain blocked.
Unhandled workflow errors are logged to console.error by default so they are visible in logs.
State updates through updateAgentState, mergeAgentState, and resetAgentState are awaited, preventing them from being silently lost.
The CHECK constraint migration now includes the 'interval' type, allowing scheduleEvery() and keepAlive() to work on DOs created with older SDK versions.
Workflow RPC callbacks ensure the Agent is initialized before executing, so this.name is hydrated and onStart() has been called when a Durable Object wakes via native RPC.
Alarm wakeups now run PartyServer initialization before scheduled tasks, so this.name is available and onStart runs.
Repeated calls with the same callback name, interval, and payload return the existing schedule instead of creating duplicates; different intervals or payloads create separate schedules.
Makes
_emitprotected so subclasses can use it.Unhandled errors thrown from run() are caught and reported to the Agent through onWorkflowError before being re-thrown.
The router registers lowercase agent-name keys in addition to original and kebab-case forms so lowercased email addresses resolve correctly.
Malformed messages now receive a JSON-RPC -32600 Invalid Request response instead of an unhandled exception.
agents 0.69 changes
Deprecations 1
Emits a one-time console warning when RPC transport uses a Durable Object binding, noting that the API is experimental and linking to the feedback issue.
New APIs and options 2
Can now connect an Agent to an McpAgent in the same Worker by passing a Durable Object namespace, with type-safe HTTP and RPC overloads.
Adds a distinct options type for RPC MCP connections, so props are available only when passing a Durable Object binding.
Behavior and default changes 2
RPC connections survive Durable Object hibernation: binding names and props are persisted and restored without manually re-establishing connections in onStart().
No longer required for non-OAuth MCP servers. OAuth servers still require it, and an explanatory error is thrown if it is missing.
Fixes and other changes 4
Repeated calls with the same server name return the existing connection instead of creating duplicates; connection IDs remain stable across hibernation restore.
Isolates errors per tool so one malformed schema cannot crash type generation.
Falls back to an object schema when inputSchema is missing and isolates per-tool errors so one bad MCP tool does not break the tool set.
Handles recursive and deeply nested schemas, internal JSON Pointers, tuples, OpenAPI nullable schemas, and escaping in generated TypeScript.
agents 0.519 changes
Breaking changes 3
Callback errors are returned as structured results instead of throwing unhandled exceptions; active connections transition to failed and errors are surfaced to clients via WebSocket broadcast.
The when type is now a discriminated union instead of a flat object with optional fields.
Scheduled dates are now represented as ISO 8601 strings instead of Date values.
New APIs and options 10
Exported from the top-level agents package so it can be imported directly.
Configure retries for MCP connections.
Check whether protocol messages are enabled for a connection.
Set class-level retry defaults for an entire agent class.
Configure per-task retries when enqueueing; retry options are persisted with the task and validated eagerly.
An exported type for configuring retry behavior.
Configure per-task retries when scheduling; retry options are persisted with the task and validated eagerly.
Configure per-task retries when scheduling recurring tasks; retry options are persisted with the task and validated eagerly.
Override this hook to suppress automatic protocol text frames for selected connections while keeping RPC and regular messaging working.
Retry any async operation with exponential backoff and jitter, with an optional predicate to stop retrying non-retryable errors.
Behavior and default changes 2
This method now returns its value directly instead of a Promise; existing code using await remains compatible.
This getter now returns its value directly instead of a Promise; existing code using await remains compatible.
Fixes and other changes 4
Uses the Agent's
createMcpOAuthProvider()override instead of hardcoding the default provider when restoring connections.Deeply nested state types no longer trigger excessively deep TypeScript instantiation errors; recursion bails out to true after 10 levels.
The readonly status now survives Durable Object hibernation by re-wrapping connections after the in-memory accessor cache is cleared.
WorkerTransport now sends keepalive pings on POST SSE streams so proxies and infrastructure do not silently drop long-running responses.
agents 0.422 changes
Breaking changes 4
The upgraded MCP SDK rejects connecting a server instance that has already been connected to a transport; create a new instance per request for stateless MCP servers.
The type now uses v2 fields, so code accessing its fields in callbacks must be updated.
Replace the legacy x402 peer dependency with @x402/core and @x402/evm for the x402 MCP integration.
The account type changes from viem.Account to ClientEvmSigner, which is structurally compatible with privateKeyToAccount().
Security 2
Add a callbackPath option to prevent instance name leakage in MCP OAuth callback URLs; it is required when sendIdentityOnConnect is false.
New hook for readonly connection support, which restricts WebSocket clients from modifying agent state.
Deprecations 2
The server-side hook remains functional but emits a one-time console warning per class; overriding both state hooks throws.
The version field is deprecated and ignored because the protocol version is determined automatically.
New APIs and options 6
Add an Agent method that subclasses can override to customize the OAuth provider used when connecting to MCP servers.
New hook for checking whether a connection is readonly.
Export for converting legacy network names to CAIP-2 format.
This server-side hook is a drop-in replacement for onStateUpdate, with the same signature and behavior.
Client-side callback for handling rejected state updates.
New hook for setting a connection to readonly, restricting client state changes and mutating callable methods.
Behavior and default changes 4
Server-side facilitator connection is deferred until the first paid tool invocation.
Payment tokens support both v2 and v1 HTTP headers.
Rejections now propagate a CF_AGENT_STATE_ERROR message back to the client.
The network setting is optional; the client selects from available payment requirements.
Fixes and other changes 4
With @cloudflare/ai-chat and Vite SSR, getCurrentAgent().connection is no longer undefined inside onChatMessage and tool execute functions.
Throwing or missing callbacks no longer block the queue indefinitely; failing items are dequeued and subsequent tasks can proceed.
Fix useAgent and AgentClient crashes when using basePath routing.
The cors option is passed through to partyserver's native CORS support, which handles preflight and response headers.
agents 0.314 changes
Breaking changes 2
Calling close() immediately rejects pending RPC calls instead of waiting for the WebSocket close handshake to complete.
The ai peer dependency is no longer marked optional, affecting package installation requirements.
Security 4
authError is escaped to prevent XSS attacks and stored in connection state so displaying the error does not require script tags.
Cloudflare Agents has a Reflected Cross-Site Scripting (XSS) vulnerability in AI Playground site
The query cache is invalidated on disconnect to prevent stale auth tokens.
Adds secure email reply routing with HMAC-SHA256 signatures.
New APIs and options 2
Adds Cloudflare Workflows integration for durable multi-step processing.
SQL errors are piped into the existing onError method using the new SqlError class.
Behavior and default changes 1
State management is significantly improved.
Fixes and other changes 5
Fixed AgentWorkflow.run() so its initialization wrapper is called in production, ensuring _initAgent is invoked.
On invalid OAuth state, clears auth_url and sets the MCP connection state to FAILED, ready for reconnection.
Initialize params are now saved for stateless MCP servers, affecting elicitation and other optional features.
Callable methods can now return this.state.
Error handling for not found changes with the MCP SDK update.
agents 0.254 changes
Breaking changes 7
AI SDK packages are now peer dependencies.
OAuth state handling is hardened against replay and DoS attacks; the state parameter format changed, so inflight flows started on a previous version will not complete.
Discovery failures now throw errors immediately instead of continuing with empty arrays.
init() no longer triggers discovery automatically; use discover() or MCPClientManager.discoverIfConnected().
Adds a method to establish an MCP server connection, replacing part of connect().
Client edge transports were removed, and deprecation warnings direct developers to update imports to the MCP TypeScript SDK.
The non-standard url field is removed from RequestExtra in WorkerTransport to align with MCP spec types.
Security 1
OAuth errors are handled, and redirect URLs are validated.
Deprecations 2
AgentNamespace is deprecated because it makes autogenned types harder to use.
connect() is deprecated but continues to work for backward compatibility.
New APIs and options 18
Client-defined tools are now supported.
Options for prepareSendMessagesRequest are now supported.
The MCP client now has a default JSON schema validator.
Adds a method to abort in-flight discoveries.
Adds lifecycle-managed discovery with cancellation of previous in-flight discovery and a configurable timeout that defaults to 15 seconds.
Adds a simpler way to discover capabilities per server.
Adds an event for tracking all server state changes.
Adds a method to register MCP servers, replacing part of connect().
Adds an enum formalizing the possible MCP connection states.
Resumable streaming is available with minimal setup.
Adds a CLI command to initialize an agents project; the command is currently a stub.
Adds a CLI command to deploy agents to Cloudflare; the command is currently a stub.
Adds a CLI command to initialize an agents project; the command is currently a stub.
Adds a CLI command for the agents MCP server; the command is currently a stub.
Adds a url parameter to onmessage, which may be useful with the OpenAI Apps SDK.
MCP agent servers and streaming/SSE handlers accept a jurisdiction option to create Durable Object instances in specific geographic regions for compliance.
Adds CORS configuration to the MCP handler, including OPTIONS preflight handling and CORS headers on responses and errors.
Adds createMcpHandler for a stateless MCP Worker.
Behavior and default changes 7
The default type for Env is now Cloudflare.Env, providing a better default type for Cloudflare environments.
auth_url is broadcast as soon as it is returned.
Connecting to multiple MCP servers simultaneously is now enabled.
createConnection() now returns the connection object for immediate use.
MCP server responses use relatedRequestId in TransportOptions to send the response down a POST stream when supported by streamable-http.
Internal AI SDK stream events are converted to UIMessageStreamPart format.
The extra argument in onmessage now includes request info.
Tooling 1
Adds a CLI command to start the development server; the command is currently a stub.
Fixes and other changes 18
Scheduling works again; the schedule schema now uses the v3 version of zod to address incompatibility with AI SDK's .jsonSchema function.
Proper peer dependencies are set up for zod v4.
The cache TTL was fixed.
Accepts any supported protocol version in request headers and rejects only truly unsupported versions, aligning with stateless MCP transports.
Fixes elicitation response handling by adding a message interceptor.
Fixes cache TTL behavior.
Fixes connection handling inside tool execution.
Fixed schedule handling.
Fixes the agents CLI so it runs.
Fixes MCP SDK OAuth discovery by falling back to the root domain for some servers, including better-auth-powered servers.
Enhances request ID tracking and stream handling in useAgentChat.
Restoration now handles failed connections and starts connections in the background to avoid blocking startup.
Schedules can run longer than 30 seconds, immediate schedules run immediately, and this.destroy can be used inside a schedule.
SSE transport forwards session IDs and request headers to MCP message handlers, enabling access to headers for session management.
The auth URL is now cleared after a successful OAuth callback, preventing endless reconnection.
Fix OAuth redirect handling in MCP clients.
Fixes the OAuth2 client.
Fixed the OAuth2 client flow.