agents@0.25.0

cloudflare/agentsagents@0.25.0Oct 2, 2026by github-actions[bot]

Upgrading?

AI Summary

Adds experimental models (ai-sdk, pi-ai) and harnesses (pi), introduces persistent browser tools, and fixes various streaming and agent tool issues.

Key Highlights

  • Adds experimental `agents/models/ai-sdk` and `agents/models/pi-ai` providers for Workers AI/AI Gateway.
  • Adds experimental `agents/harnesses/pi` to host pi-durable sessions in a Durable Object.
  • Adds persistent browser tools for AI SDK and TanStack AI.
  • Fixes agent-tool chunks being duplicated or dropped on reconnect, fiber recovery, and sub-agent WebSocket connections.

New Features

  • agents/models/ai-sdk provider
  • agents/models/pi-ai provider
  • agents/harnesses/pi harness
  • Persistent browser tools
  • eventDelivery: 'terminal' option for runAgentTool

Full Release Notes

### Minor Changes

-   [#2005](https://github.com/cloudflare/agents/pull/2005) [`c2f7672`](https://github.com/cloudflare/agents/commit/c2f767235e749cb3f6334ed22e70a03940dcd18c) Thanks [@cjol](https://github.com/cjol)! - Native RPC calls to async Agent and Think methods now start lifecycle initialization first; address Agents by name because raw IDs from `newUniqueId()` and `idFromString()` now fail their first async RPC. See [Lifecycle](https://github.com/cloudflare/agents/blob/main/docs/agents/lifecycle.md).

### Patch Changes

-   [#2390](https://github.com/cloudflare/agents/pull/2390) [`c55ec80`](https://github.com/cloudflare/agents/commit/c55ec80087ba2531ccdc9e211921fb5bf6ddb065) Thanks [@threepointone](https://github.com/threepointone)! - Report a failed agent-tool child as failed even when it was evicted before recording the failure. See [Agent tools](https://github.com/cloudflare/agents/blob/main/docs/agents/agent-tools.md).

-   [#2384](https://github.com/cloudflare/agents/pull/2384) [`f904999`](https://github.com/cloudflare/agents/commit/f9049991fe9ca637b5326788e08e1cea6b4280c1) Thanks [@threepointone](https://github.com/threepointone)! - Fix agent-tool chunks being duplicated or dropped on reconnect, child re-attach, and fiber recovery. See [Agent tools](https://github.com/cloudflare/agents/blob/main/docs/agents/agent-tools.md).

-   [#2364](https://github.com/cloudflare/agents/pull/2364) [`5e0507e`](https://github.com/cloudflare/agents/commit/5e0507e5f1ba27cc7c2bf2920c380a7c8f9caaad) Thanks [@threepointone](https://github.com/threepointone)! - Add `eventDelivery: "terminal"` to `runAgentTool` to forward only lifecycle, progress, and milestone events for a run. See [Agent tools](https://github.com/cloudflare/agents/blob/main/docs/agents/agent-tools.md).

-   [#2448](https://github.com/cloudflare/agents/pull/2448) [`54f9ca7`](https://github.com/cloudflare/agents/commit/54f9ca793e75f627c4ab33a8ee15df526770883d) Thanks [@aron-cf](https://github.com/aron-cf)! - Add experimental `agents/models/ai-sdk`, a provider for Workers AI and AI Gateway over the `AI` binding. See [Models](https://github.com/cloudflare/agents/blob/main/docs/agents/models.md).

-   [#2446](https://github.com/cloudflare/agents/pull/2446) [`5cf86f8`](https://github.com/cloudflare/agents/commit/5cf86f8cd6117843de45f41f10a7cc4cdc27340b) Thanks [@aron-cf](https://github.com/aron-cf)! - Add experimental `agents/models/pi-ai`, a pi-ai provider for Workers AI and AI Gateway over the `AI` binding. See [Models for pi-ai](https://github.com/cloudflare/agents/blob/main/docs/agents/models-pi-ai.md).

-   [#2424](https://github.com/cloudflare/agents/pull/2424) [`1e54cf1`](https://github.com/cloudflare/agents/commit/1e54cf19d747f122c141e0eb323226ec8b4d4865) Thanks [@aron-cf](https://github.com/aron-cf)! - Add experimental `agents/harnesses/pi` to host pi-durable sessions in a Durable Object. See [Pi harness](https://github.com/cloudflare/agents/blob/main/docs/agents/harnesses/pi.md) and the [runnable example](https://github.com/cloudflare/agents/tree/main/examples/next/harnesses/pi).

-   [#2391](https://github.com/cloudflare/agents/pull/2391) [`d3fe93c`](https://github.com/cloudflare/agents/commit/d3fe93cd968ea4d8e57a909dcbfd56b879df77e0) Thanks [@threepointone](https://github.com/threepointone)! - Keep a tool call's input when its approval request arrives before the input finishes streaming ([#1872](https://github.com/cloudflare/agents/issues/1872)). See [Human in the loop](https://github.com/cloudflare/agents/blob/main/docs/agents/human-in-the-loop.md).

-   [#2369](https://github.com/cloudflare/agents/pull/2369) [`9b70fdb`](https://github.com/cloudflare/agents/commit/9b70fdbfeb8ebebfda1f1dfc2628cceece8b39d5) Thanks [@ben-reitz](https://github.com/ben-reitz)! - `loadCdpSpec` accepts an optional `sessionId` to read the protocol from an existing Browser Run session. See [Browse the web](https://github.com/cloudflare/agents/blob/main/docs/agents/browse-the-web.md).

-   [#2368](https://github.com/cloudflare/agents/pull/2368) [`ed4f5ab`](https://github.com/cloudflare/agents/commit/ed4f5ab68a64fae48a148699e3f9955590743131) Thanks [@ben-reitz](https://github.com/ben-reitz)! - `connectBrowserSession` throws a `BrowserRenderingError` with the HTTP status when Browser Run returns no WebSocket. See [Browse the web](https://github.com/cloudflare/agents/blob/main/docs/agents/browse-the-web.md).

-   [#2294](https://github.com/cloudflare/agents/pull/2294) [`abda4e3`](https://github.com/cloudflare/agents/commit/abda4e3ab57e5ba435af45bc9ba62999eebb46c3) Thanks [@ben-reitz](https://github.com/ben-reitz)! - Add Browser Run hostname guardrails, close and activity callbacks, and the `CdpConnection` name while retaining `CdpSession` as a deprecated alias. See [Browse the web](https://github.com/cloudflare/agents/blob/main/docs/agents/browse-the-web.md).

-   [#2372](https://github.com/cloudflare/agents/pull/2372) [`6e1c346`](https://github.com/cloudflare/agents/commit/6e1c3467338b092da04a058594cd47fca13556db) Thanks [@ben-reitz](https://github.com/ben-reitz)! - Add persistent browser tools for AI SDK and TanStack AI, backed by experimental Browser sessions. See [Browse the web](https://github.com/cloudflare/agents/blob/main/docs/agents/browse-the-web.md).

-   [#2371](https://github.com/cloudflare/agents/pull/2371) [`9cddcd3`](https://github.com/cloudflare/agents/commit/9cddcd3e7687177dca9c10c6569473edcb0f51ed) Thanks [@ben-reitz](https://github.com/ben-reitz)! - `CdpConnection.send()` rejects immediately when its socket is closed instead of waiting for the timeout. See [Browse the web](https://github.com/cloudflare/agents/blob/main/docs/agents/browse-the-web.md).

-   [#2379](https://github.com/cloudflare/agents/pull/2379) [`d49aa82`](https://github.com/cloudflare/agents/commit/d49aa822608b7a39184b0a3825fdd813c3b6b778) Thanks [@ben-reitz](https://github.com/ben-reitz)! - `cdp.spec()` and `loadCdpSpec()` now include command parameters, return types, and type details, so a model can see how to call a CDP method. See [Browse the web](https://github.com/cloudflare/agents/blob/main/docs/agents/browse-the-web.md).

-   [#2394](https://github.com/cloudflare/agents/pull/2394) [`e837967`](https://github.com/cloudflare/agents/commit/e8379676b7f034936730f51153360a3bb8df751c) Thanks [@threepointone](https://github.com/threepointone)! - `useAgentChat` loads the new agent's history when the agent address passed to `useAgent` changes ([#1864](https://github.com/cloudflare/agents/issues/1864), [#1874](https://github.com/cloudflare/agents/issues/1874)). See [Client SDK](https://github.com/cloudflare/agents/blob/main/docs/agents/client-sdk.md).

-   [#2378](https://github.com/cloudflare/agents/pull/2378) [`dbf170c`](https://github.com/cloudflare/agents/commit/dbf170cf7d0313ffe79d7d6a84201841f2e12184) Thanks [@threepointone](https://github.com/threepointone)! - `useAgentChat` gains `onTurnEnd`, and terminal chat frames carry outcomes and user message IDs so clients can settle sends correctly across recovery and reconnects. Replay, tool callbacks, and turn state now remain consistent through terminal delivery; see [Chat agents](https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md).

-   [#2019](https://github.com/cloudflare/agents/pull/2019) [`d5562e0`](https://github.com/cloudflare/agents/commit/d5562e0f2ee31be049ccf2d86c3cb58de20ee9d4) Thanks [@justanotherbyte](https://github.com/justanotherbyte)! - A WebSocket close before the final `done` frame now puts `useAgentChat` in the `error` state instead of showing a truncated answer as complete ([#2013](https://github.com/cloudflare/agents/issues/2013)). See [Chat agents](https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md).

-   [#2036](https://github.com/cloudflare/agents/pull/2036) [`040db5c`](https://github.com/cloudflare/agents/commit/040db5c9342d74c84340858f04fd5410f84ff4f8) Thanks [@justanotherbyte](https://github.com/justanotherbyte)! - Stop storing compaction summaries that clients echo back, and hide duplicates already stored ([#1984](https://github.com/cloudflare/agents/issues/1984)). See [Sessions](https://github.com/cloudflare/agents/blob/main/docs/agents/sessions.md).

-   [#2405](https://github.com/cloudflare/agents/pull/2405) [`11f87b5`](https://github.com/cloudflare/agents/commit/11f87b5332f6cf4dfff71d8249621b28f539280f) Thanks [@threepointone](https://github.com/threepointone)! - Context blocks can set `whenChanged: "remind"` to send changes as a reminder after the cached prompt instead of rewriting it. See [Context](https://github.com/cloudflare/agents/blob/main/docs/agents/context.md).

-   [#2399](https://github.com/cloudflare/agents/pull/2399) [`cbb859b`](https://github.com/cloudflare/agents/commit/cbb859b3c5be8c925e836703afd4ef9ee30f8c3c) Thanks [@threepointone](https://github.com/threepointone)! - Sub-agent broadcasts make at most one root call, and none when no client would receive them. See [Sub-agents](https://github.com/cloudflare/agents/blob/main/docs/agents/sub-agents.md).

-   [#2398](https://github.com/cloudflare/agents/pull/2398) [`d44b67d`](https://github.com/cloudflare/agents/commit/d44b67da8e2e02a722bfc7bca452cb3852bbc771) Thanks [@threepointone](https://github.com/threepointone)! - Sub-agents no longer sync root-owned host jobs, which could fail a facet's first call after restart. See [Sub-agents](https://github.com/cloudflare/agents/blob/main/docs/agents/sub-agents.md).

-   [#2400](https://github.com/cloudflare/agents/pull/2400) [`498bc29`](https://github.com/cloudflare/agents/commit/498bc29e253b18331ac4a0b09ed1723bb375ef42) Thanks [@threepointone](https://github.com/threepointone)! - Fix WebSocket connections to sub-agents nested more than one level deep. See [Sub-agents](https://github.com/cloudflare/agents/blob/main/docs/agents/sub-agents.md).

-   [#2344](https://github.com/cloudflare/agents/pull/2344) [`a91f669`](https://github.com/cloudflare/agents/commit/a91f669d4408b60af8d5771bae293ca9ebe948cd) Thanks [@threepointone](https://github.com/threepointone)! - `useAgentChat` lets the server snapshot repair a scrambled cross-tab or resumed assistant message instead of keeping it until reload. See [Chat agents](https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md).

-   [#2361](https://github.com/cloudflare/agents/pull/2361) [`7588509`](https://github.com/cloudflare/agents/commit/7588509eab3f9175325495d30710f9951a90ae78) Thanks [@threepointone](https://github.com/threepointone)! - `useAgentChat` calls `onToolCall` only after the stream ends, and only for tool calls still waiting on the client ([#2195](https://github.com/cloudflare/agents/issues/2195)). See [Client tools](https://github.com/cloudflare/agents/blob/main/docs/agents/client-tools-continuation.md).

-   [#2238](https://github.com/cloudflare/agents/pull/2238) [`c3a4010`](https://github.com/cloudflare/agents/commit/c3a401006b482fab061030ac13536e1e0025fd59) Thanks [@mattzcarey](https://github.com/mattzcarey)! - Interfaces can now be used as `Props` on `Agent`, `AIChatAgent`, `Think`, and routing helpers. See [Routing](https://github.com/cloudflare/agents/blob/main/docs/agents/routing.md).

-   [#2040](https://github.com/cloudflare/agents/pull/2040) [`2afe0e0`](https://github.com/cloudflare/agents/commit/2afe0e0ba9eb91605adb0bcac289e9df8a723aa7) Thanks [@AntoniTok](https://github.com/AntoniTok)! - Keep assistant messages and tool outputs attached to the correct turn when a provider reuses a `toolCallId`; `resolveToolMergeId` is deprecated in favour of `reconcileMessages`. See [Chat agents](https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md).

-   [#2402](https://github.com/cloudflare/agents/pull/2402) [`01d190e`](https://github.com/cloudflare/agents/commit/01d190e69601d67b8f905f09cf4bf1a78df7b242) Thanks [@threepointone](https://github.com/threepointone)! - `useAgent` and `AgentClient` resolve `ready` only after the agent's state arrives, so `state` is no longer briefly `undefined` ([#2268](https://github.com/cloudflare/agents/issues/2268)). See [Client SDK](https://github.com/cloudflare/agents/blob/main/docs/agents/client-sdk.md).

-   [#2039](https://github.com/cloudflare/agents/pull/2039) [`c658b83`](https://github.com/cloudflare/agents/commit/c658b832d5aa32c45b64b7748aac1c02ea370003) Thanks [@justanotherbyte](https://github.com/justanotherbyte)! - `useAgentChat` keeps messages sent while disconnected when reconnecting, including Think transcripts, instead of erasing them ([#1983](https://github.com/cloudflare/agents/issues/1983)). See [Chat agents](https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md).

-   [#2322](https://github.com/cloudflare/agents/pull/2322) [`677c022`](https://github.com/cloudflare/agents/commit/677c022b4460e1a03c3afc5934aba85cde20ddda) Thanks [@threepointone](https://github.com/threepointone)! - Correct the documented default and unit of `ChatRecoveryConfig.maxRecoveryWork`. See [Chat agents: recovery work units](https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md#recovery-work-units).

-   [#2401](https://github.com/cloudflare/agents/pull/2401) [`218df4a`](https://github.com/cloudflare/agents/commit/218df4aaf443e482f553dfeb0633d204b37752c6) Thanks [@threepointone](https://github.com/threepointone)! - 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` ([#2118](https://github.com/cloudflare/agents/issues/2118)). See [Sub-agents](https://github.com/cloudflare/agents/blob/main/docs/agents/sub-agents.md).

-   [#2348](https://github.com/cloudflare/agents/pull/2348) [`39361fa`](https://github.com/cloudflare/agents/commit/39361fa8c2194bb46c2b165454726252cca80c34) Thanks [@threepointone](https://github.com/threepointone)! - Fix text appearing twice when reconnecting during a tool continuation. See [Resumable streaming](https://github.com/cloudflare/agents/blob/main/docs/agents/resumable-streaming.md).

-   [#2340](https://github.com/cloudflare/agents/pull/2340) [`3b278b2`](https://github.com/cloudflare/agents/commit/3b278b2c987f47247e551731a1fea9b6dd154456) Thanks [@threepointone](https://github.com/threepointone)! - `onChatResponse` still fires, with `recovered: true`, for a turn persisted just before a Durable Object reset ([#2266](https://github.com/cloudflare/agents/issues/2266), [#1842](https://github.com/cloudflare/agents/issues/1842)). See [Think lifecycle hooks](https://github.com/cloudflare/agents/blob/main/docs/think/lifecycle-hooks.md).

-   [#2363](https://github.com/cloudflare/agents/pull/2363) [`d72d343`](https://github.com/cloudflare/agents/commit/d72d343a9f6fde0a89f9b8f1be0ddc8ed2ba4f1f) Thanks [@threepointone](https://github.com/threepointone)! - `runFiber()` no longer calls `onFiberRecovered()` for work that already finished ([#2305](https://github.com/cloudflare/agents/issues/2305)). See [Durable execution](https://github.com/cloudflare/agents/blob/main/docs/agents/durable-execution.md).

-   [#2404](https://github.com/cloudflare/agents/pull/2404) [`9d125c8`](https://github.com/cloudflare/agents/commit/9d125c8d75571ccde8abb8c0c75ff343a7ef149a) Thanks [@threepointone](https://github.com/threepointone)! - Add `session.mirror()` to keep an in-memory transcript in sync with a session's change feed. See [Sessions](https://github.com/cloudflare/agents/blob/main/docs/agents/sessions.md).

-   [#2236](https://github.com/cloudflare/agents/pull/2236) [`14f7c6a`](https://github.com/cloudflare/agents/commit/14f7c6a46e6c81492c4e663ada49895187dae9c3) Thanks [@mattzcarey](https://github.com/mattzcarey)! - Keep attachment references when a message that already contains attachment pointers is written back, so its media isn't garbage-collected. See [Sessions](https://github.com/cloudflare/agents/blob/main/docs/agents/sessions.md).

-   [#2231](https://github.com/cloudflare/agents/pull/2231) [`040458e`](https://github.com/cloudflare/agents/commit/040458edb8f2c87a25e5ac446709054a5f553e14) Thanks [@mattzcarey](https://github.com/mattzcarey)! - `updateMessage()` detects unchanged messages from a stored content hash, cutting reads on large messages. See [Sessions](https://github.com/cloudflare/agents/blob/main/docs/agents/sessions.md).

-   [#2392](https://github.com/cloudflare/agents/pull/2392) [`4f26402`](https://github.com/cloudflare/agents/commit/4f2640204adb629fe6bf0143ed43e65fc6a46703) Thanks [@threepointone](https://github.com/threepointone)! - Settle approved tool calls that never ran once the conversation moves past them, so later turns don't send unresolved tool calls ([#2382](https://github.com/cloudflare/agents/issues/2382)). See [Human in the loop](https://github.com/cloudflare/agents/blob/main/docs/agents/human-in-the-loop.md).

-   [#2387](https://github.com/cloudflare/agents/pull/2387) [`9f70bc8`](https://github.com/cloudflare/agents/commit/9f70bc82db11b2a5ee9f5f8f3134991b21d21c55) Thanks [@threepointone](https://github.com/threepointone)! - Messenger replies hold the thread lock and retain queued follow-ups during slow delivery; typing updates are serialized and settle before reply text arrives. See [Think messengers](https://github.com/cloudflare/agents/blob/main/docs/think/messengers.md).

-   [#2417](https://github.com/cloudflare/agents/pull/2417) [`9906881`](https://github.com/cloudflare/agents/commit/99068812e5e91f039a15d0848e8e0bdf27177158) Thanks [@threepointone](https://github.com/threepointone)! - A regeneration interrupted by a restart now recovers on its own branch. See [Multi-chat](https://github.com/cloudflare/agents/blob/main/docs/think/multi-chat.md).

-   [#2403](https://github.com/cloudflare/agents/pull/2403) [`6b5b4a0`](https://github.com/cloudflare/agents/commit/6b5b4a0156249079b71d69214743c6a055958bef) Thanks [@threepointone](https://github.com/threepointone)! - Fix `useAgentChat` throwing "Maximum update depth exceeded" during long streamed answers ([#2217](https://github.com/cloudflare/agents/issues/2217)). See [Chat agents](https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md).

-   [#2366](https://github.com/cloudflare/agents/pull/2366) [`aaba6cb`](https://github.com/cloudflare/agents/commit/aaba6cbb66e9b0c35b2a7589a009e9cb3b7f44a1) Thanks [@ben-reitz](https://github.com/ben-reitz)! - With `storeTools: true`, oversized tool payloads are recorded with base64 data summarized instead of being dropped. See [Observability](https://github.com/cloudflare/agents/blob/main/docs/agents/observability.md).

-   [#2343](https://github.com/cloudflare/agents/pull/2343) [`a2f6f94`](https://github.com/cloudflare/agents/commit/a2f6f944bfc4a9e1c878e2f74822c9ef98c35857) Thanks [@threepointone](https://github.com/threepointone)! - Harden transient chat recovery across Think and AI Chat, including retry budgeting, cancellation, terminal error delivery, and recovery after restarts. See the [`agents/chat` recovery helpers](https://github.com/cloudflare/agents/blob/main/docs/think/lifecycle-hooks.md).

-   [#2024](https://github.com/cloudflare/agents/pull/2024) [`310c343`](https://github.com/cloudflare/agents/commit/310c3433f2a250a41cbb9208188499bd60a5f4d2) Thanks [@cjol](https://github.com/cjol)! - `deleteSubAgent` now closes the sub-agent's direct client connections, so late messages can't recreate it ([#2003](https://github.com/cloudflare/agents/issues/2003)). See [Sub-agents](https://github.com/cloudflare/agents/blob/main/docs/agents/sub-agents.md).

-   [#2339](https://github.com/cloudflare/agents/pull/2339) [`1edc989`](https://github.com/cloudflare/agents/commit/1edc989c82c58879c37ed8e81f5d6813fb4599eb) Thanks [@threepointone](https://github.com/threepointone)! - Truncate older tool results after model conversion so `toModelOutput` and provider-executed tools keep valid outputs ([#2014](https://github.com/cloudflare/agents/issues/2014)). See [Sessions](https://github.com/cloudflare/agents/blob/main/docs/agents/sessions.md).

-   [#2272](https://github.com/cloudflare/agents/pull/2272) [`5dbf6c2`](https://github.com/cloudflare/agents/commit/5dbf6c2e6bc99bc27154f8e66043cacb4473d180) Thanks [@mattzcarey](https://github.com/mattzcarey)! - `withX402Client` enforces `maxPaymentValue` against the payment requirement selected for signing, before signing or retrying the tool call. See [Pay from Agents SDK](https://developers.cloudflare.com/agents/tools/payments/x402/pay-from-agents-sdk/).

Related Repositories