@cloudflare/think@0.20.0

siddharthvaddem/openscreen@cloudflare/think@0.20.0Oct 2, 2026by github-actions[bot]

Upgrading?

AI Summary

Introduces support for AI SDK v7 dependencies and changes how scheduled tasks are scoped, while fixing various chat and messenger issues.

Key Highlights

  • Requires ai@^7 and @ai-sdk/react@^4
  • Browser chat turns now use the 'web' channel
  • Fixes agent-tool chunk handling and error reporting

Breaking Changes

  • Scheduled tasks now run on the root agent only; override getScheduledTasksScope() to return 'all' for per-facet scheduling

New Features

  • Context blocks can set whenChanged: 'remind' to send changes as a reminder
  • Messenger attachments load when fetchData returns a plain ArrayBuffer
  • Messenger replies see every message in a quick burst

Full Release Notes

### Minor Changes

-   [#2388](https://github.com/cloudflare/agents/pull/2388) [`1031c0f`](https://github.com/cloudflare/agents/commit/1031c0f5c85f80ce0879dd8b07f151f3293c9120) Thanks [@threepointone](https://github.com/threepointone)! - Require `ai@^7` and `@ai-sdk/react@^4`, because Think bundles providers that return AI SDK v7 models. See [Think dependencies](https://github.com/cloudflare/agents/blob/main/docs/think/index.md#dependencies).

-   [#2056](https://github.com/cloudflare/agents/pull/2056) [`20142e5`](https://github.com/cloudflare/agents/commit/20142e52901ddbbb0d940ecef0e82ec9e7d01cab) Thanks [@AntoniTok](https://github.com/AntoniTok)! - Breaking: declared scheduled tasks now run on the root agent only; override `getScheduledTasksScope()` to return `"all"` for per-facet scheduling. See [Think scheduled tasks](https://github.com/cloudflare/agents/blob/main/docs/think/index.md#scheduled-tasks).

-   [#2330](https://github.com/cloudflare/agents/pull/2330) [`e80278e`](https://github.com/cloudflare/agents/commit/e80278e2f484c55124884e5a2fc5bd215eaf77fa) Thanks [@threepointone](https://github.com/threepointone)! - Browser chat turns now use the `web` channel, so its configured tools and turn limit apply. See [Think channels](https://github.com/cloudflare/agents/blob/main/docs/think/channels.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).

-   [#2334](https://github.com/cloudflare/agents/pull/2334) [`7f564e7`](https://github.com/cloudflare/agents/commit/7f564e7bfeee6ec976c12ce1e4dbbaa150906d26) Thanks [@threepointone](https://github.com/threepointone)! - AI Chat and Think send the terminal `done` frame after persisting and broadcasting the assistant reply, so later sends are not overwritten. See [Chat agents](https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md).

-   [#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).

-   [#2326](https://github.com/cloudflare/agents/pull/2326) [`a3e4eef`](https://github.com/cloudflare/agents/commit/a3e4eef6a77d821819d5438105287700ea1c6426) Thanks [@threepointone](https://github.com/threepointone)! - Fix two Think warnings that fired, or failed to fire, because of a false method-override check. See [Think lifecycle hooks](https://github.com/cloudflare/agents/blob/main/docs/think/lifecycle-hooks.md).

-   [#2408](https://github.com/cloudflare/agents/pull/2408) [`6c8f85a`](https://github.com/cloudflare/agents/commit/6c8f85a571802881e5e380ecce03eb24d6fb5f71) Thanks [@threepointone](https://github.com/threepointone)! - Require `agents@>=0.25.0` so Think and AI Chat can import the chat helpers provided by that release.

-   [#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).

-   [#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).

-   [#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).

-   [#2393](https://github.com/cloudflare/agents/pull/2393) [`a7d0e02`](https://github.com/cloudflare/agents/commit/a7d0e02a2b5cfb651b34f8f7970eed4f172658c6) Thanks [@threepointone](https://github.com/threepointone)! - Continuation turns that fail before streaming now report an error to clients and `onChatResponse` instead of appearing to hang ([#2381](https://github.com/cloudflare/agents/issues/2381)). See [Client tools](https://github.com/cloudflare/agents/blob/main/docs/agents/client-tools-continuation.md).

-   [#2323](https://github.com/cloudflare/agents/pull/2323) [`57e2e46`](https://github.com/cloudflare/agents/commit/57e2e46ee14eb5df72a8569074f43e4f4f336d0e) Thanks [@threepointone](https://github.com/threepointone)! - Messenger attachments load when `fetchData` returns a plain `ArrayBuffer`. See [Messengers](https://github.com/cloudflare/agents/blob/main/docs/think/messengers.md).

-   [#2325](https://github.com/cloudflare/agents/pull/2325) [`6289a15`](https://github.com/cloudflare/agents/commit/6289a15794ca308f971ed978cd5adc4d27e6a546) Thanks [@threepointone](https://github.com/threepointone)! - Messenger replies now see every message in a quick burst, not just the last one. See [Messengers](https://github.com/cloudflare/agents/blob/main/docs/think/messengers.md).

-   [#2324](https://github.com/cloudflare/agents/pull/2324) [`34df44b`](https://github.com/cloudflare/agents/commit/34df44b9f0b5b6c47674a746cc4071df824baceb) Thanks [@threepointone](https://github.com/threepointone)! - Messenger replies no longer post a `...` placeholder on adapters without native streaming. See [Messengers](https://github.com/cloudflare/agents/blob/main/docs/think/messengers.md).

-   [#2347](https://github.com/cloudflare/agents/pull/2347) [`00a07bd`](https://github.com/cloudflare/agents/commit/00a07bdc5b68c4537c15c551c47f62b3283764d4) Thanks [@threepointone](https://github.com/threepointone)! - A recovered messenger turn delivers its answer to the thread instead of an "interrupted" apology. See [Messengers](https://github.com/cloudflare/agents/blob/main/docs/think/messengers.md).

-   [#2353](https://github.com/cloudflare/agents/pull/2353) [`06d50eb`](https://github.com/cloudflare/agents/commit/06d50ebf65460e52b4ca292c9cd6d7f44fb6c706) Thanks [@threepointone](https://github.com/threepointone)! - `rejectExecution()` accepts `{ autoContinue: false }` to record a rejection without starting another turn. See [Actions](https://github.com/cloudflare/agents/blob/main/docs/think/actions.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).

-   [#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).

-   [#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).

-   [#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).

-   [#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).

-   [#2321](https://github.com/cloudflare/agents/pull/2321) [`7d58ade`](https://github.com/cloudflare/agents/commit/7d58ade09cfaa67cde194e75ff76b40fed8faf6d) Thanks [@threepointone](https://github.com/threepointone)! - Think can write server-authored `messageMetadata` onto assistant messages, per agent or per turn, and recovery preserves metadata even when keys match built-in object properties. See [Think lifecycle hooks](https://github.com/cloudflare/agents/blob/main/docs/think/lifecycle-hooks.md).

-   [#2329](https://github.com/cloudflare/agents/pull/2329) [`558424c`](https://github.com/cloudflare/agents/commit/558424ce7c9ca8f4368602684a55718443b12cef) Thanks [@threepointone](https://github.com/threepointone)! - Recovery continuations extend the interrupted assistant message instead of adding a second one. See [Think](https://github.com/cloudflare/agents/blob/main/docs/think/index.md).

-   [#2331](https://github.com/cloudflare/agents/pull/2331) [`0c5fd95`](https://github.com/cloudflare/agents/commit/0c5fd959aa817845ef4e8cfde5a23de407392afe) Thanks [@threepointone](https://github.com/threepointone)! - Resolving a paused execution removes the model's now-stale "waiting for approval" text from the transcript ([#2054](https://github.com/cloudflare/agents/issues/2054)). See [Actions](https://github.com/cloudflare/agents/blob/main/docs/think/actions.md).

-   [#2355](https://github.com/cloudflare/agents/pull/2355) [`ccca389`](https://github.com/cloudflare/agents/commit/ccca38957405167bebb0d524271d5af7d55b464b) Thanks [@threepointone](https://github.com/threepointone)! - Add `getGateway(model)` to set AI Gateway options such as metadata and caching for string models ([#2262](https://github.com/cloudflare/agents/issues/2262)). See [Think](https://github.com/cloudflare/agents/blob/main/docs/think/index.md).

-   [#2388](https://github.com/cloudflare/agents/pull/2388) [`1031c0f`](https://github.com/cloudflare/agents/commit/1031c0f5c85f80ce0879dd8b07f151f3293c9120) Thanks [@threepointone](https://github.com/threepointone)! - `resolveModel()` rejects malformed model ids up front, and `@hf/...` ids get the same Workers AI settings as `@cf/...`. See [Think](https://github.com/cloudflare/agents/blob/main/docs/think/index.md).

-   [#2354](https://github.com/cloudflare/agents/pull/2354) [`d3cb4e1`](https://github.com/cloudflare/agents/commit/d3cb4e136d3d68ee66c5f5bef28ca105d3a49eff) Thanks [@threepointone](https://github.com/threepointone)! - Add `messengerConcurrency` to choose the Chat SDK concurrency strategy for messenger replies ([#2313](https://github.com/cloudflare/agents/issues/2313)). See [Messengers](https://github.com/cloudflare/agents/blob/main/docs/think/messengers.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).

-   [#2413](https://github.com/cloudflare/agents/pull/2413) [`bcb1f12`](https://github.com/cloudflare/agents/commit/bcb1f12f48a9511dcc368da8cf63fe1dba3330eb) Thanks [@threepointone](https://github.com/threepointone)! - Fix regenerate continuing the old response instead of replacing it ([#2028](https://github.com/cloudflare/agents/issues/2028)). See [Multi-chat](https://github.com/cloudflare/agents/blob/main/docs/think/multi-chat.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).

-   [#2356](https://github.com/cloudflare/agents/pull/2356) [`f92420f`](https://github.com/cloudflare/agents/commit/f92420fea9f6f17d3a1f86dba6c8c0c054769a1f) Thanks [@threepointone](https://github.com/threepointone)! - Older-message truncation moves in steps (`truncationStep`), so the prompt-cache prefix stays stable across turns ([#2200](https://github.com/cloudflare/agents/issues/2200)). See [Think](https://github.com/cloudflare/agents/blob/main/docs/think/index.md).

-   [#2328](https://github.com/cloudflare/agents/pull/2328) [`84e6e5c`](https://github.com/cloudflare/agents/commit/84e6e5cb40f8b5c589198dc7a63867fc4559c4b5) Thanks [@threepointone](https://github.com/threepointone)! - Stream-stall recovery retries stalls before the first chunk and now calls `onChatRecovery`. See [Think lifecycle hooks](https://github.com/cloudflare/agents/blob/main/docs/think/lifecycle-hooks.md).

-   [#2362](https://github.com/cloudflare/agents/pull/2362) [`7a30c1f`](https://github.com/cloudflare/agents/commit/7a30c1f3adecf4ea1a66737dc4f5dc943e89f3e1) Thanks [@threepointone](https://github.com/threepointone)! - `step.prompt()` turns interrupted mid-stream now recover with their structured output instead of failing ([#1727](https://github.com/cloudflare/agents/issues/1727)). See [Workflows](https://github.com/cloudflare/agents/blob/main/docs/think/workflows.md).

-   [#2351](https://github.com/cloudflare/agents/pull/2351) [`0b13fe0`](https://github.com/cloudflare/agents/commit/0b13fe0d8f8834857eaaf9526e20b4d0f658568f) Thanks [@threepointone](https://github.com/threepointone)! - Add `waitForSubmission()` for durable submissions and harden cancellation, status-hook, reset-turn, and paused-tool lifecycle handling so waits settle and terminal status is reported once. See [Programmatic submissions](https://github.com/cloudflare/agents/blob/main/docs/think/programmatic-submissions.md).

-   [#2414](https://github.com/cloudflare/agents/pull/2414) [`484f7ab`](https://github.com/cloudflare/agents/commit/484f7abbe7cca5261435eafb97bf4ea99cb35fb1) Thanks [@threepointone](https://github.com/threepointone)! - `telegramMessenger` adds a `nativeStreaming` option and works with `verifyWebhook` on `@chat-adapter/telegram` 4.38 ([#2397](https://github.com/cloudflare/agents/issues/2397)). See [Messengers](https://github.com/cloudflare/agents/blob/main/docs/think/messengers.md).

-   [#2350](https://github.com/cloudflare/agents/pull/2350) [`52e624e`](https://github.com/cloudflare/agents/commit/52e624e56289fccba4523b729c0abbb62c80926b) Thanks [@threepointone](https://github.com/threepointone)! - Think hooks and tools can read the running turn identity, and `activeChannel` stays scoped to its owning turn. See [Lifecycle hooks](https://github.com/cloudflare/agents/blob/main/docs/think/lifecycle-hooks.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).

-   [#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).

-   [#2290](https://github.com/cloudflare/agents/pull/2290) [`5848d71`](https://github.com/cloudflare/agents/commit/5848d71b21a96c9484811a7f65dc2591853ffe7e) Thanks [@ben-reitz](https://github.com/ben-reitz)! - `runTurn({ mode: "wait" })` returns the assistant message from its own turn, even if other turns persist in the meantime. See [Programmatic submissions](https://github.com/cloudflare/agents/blob/main/docs/think/programmatic-submissions.md).

-   [#2341](https://github.com/cloudflare/agents/pull/2341) [`caef62a`](https://github.com/cloudflare/agents/commit/caef62a30a169d9392986f548e6b7f3551548663) Thanks [@threepointone](https://github.com/threepointone)! - Wait-mode `TurnResult.output` returns the parsed structured output, and submission inspections include the persisted `messageId` ([#2263](https://github.com/cloudflare/agents/issues/2263), [#2264](https://github.com/cloudflare/agents/issues/2264)). See [Programmatic submissions](https://github.com/cloudflare/agents/blob/main/docs/think/programmatic-submissions.md).

Related Repositories