@cloudflare/think
0.21.0 · 20 Oct 2026MIT97k / weekRepositorynpmAtom feed
Latest releases
All 52 releases- 0.21.x · latest line
0.21.0
20 Oct 2026- deprecated
createExecuteToolandcreateExecuteRuntimeare deprecated in favour ofexecwith aws:toolsmodule. See Calling the agent's tools from code. - deprecated
Chat recovery now seals a turn after
chatRecovery.maxInterruptedAttemptsinterrupted attempts (default 5), so a turn that exceeds the Durable Object memory limit on every run no longer retries forever;maxOomRetriesis deprecated. See Stream Recovery. Think's workspace tools are now
@cloudflare/computer'screateAITools, andexecoffers every backend the Workspace has;createWorkspaceTools,workspaceBash, and@cloudflare/think/tools/workspaceare removed. See Built-in workspace tools.
Minor Changes
Think's workspace tools are now
@cloudflare/computer'screateAITools, andexecoffers every backend the Workspace has;createWorkspaceTools,workspaceBash, and@cloudflare/think/tools/workspaceare removed. See Built-in workspace tools.Think's
workspaceis now aWorkspacefrom@cloudflare/computer, a new peer dependency. See Upgrading to a Computer workspace.Think no longer depends on
@cloudflare/shell, and the execute tool'sstateoption is removed. See Code Execution Tool.- deprecated
createExecuteToolandcreateExecuteRuntimeare deprecated in favour ofexecwith aws:toolsmodule. See Calling the agent's tools from code.
Patch Changes
- deprecated
Chat recovery now seals a turn after
chatRecovery.maxInterruptedAttemptsinterrupted attempts (default 5), so a turn that exceeds the Durable Object memory limit on every run no longer retries forever;maxOomRetriesis deprecated. See Stream Recovery. Reuse one
Intl.DateTimeFormatper timezone when computing wall-clock scheduled task occurrences, cutting the CPU cost of each occurrence substantially. See #2583; thanks @Bowiemb.
- 0.20.x · maintenance
0.20.2
9 Oct 2026fetch_urlnow blocks private and local hosts using the shared policy fromagents/webfetch. See Fetch the Web: URL policy.
0.20.1
7 Oct 2026Fix a chat that could stall when the model chains fast client tool calls across steps.
0.20.0
2 Oct 2026- breaking
declared scheduled tasks now run on the root agent only; override
getScheduledTasksScope()to return"all"for per-facet scheduling. See Think scheduled tasks. - deprecated
Keep assistant messages and tool outputs attached to the correct turn when a provider reuses a
toolCallId;resolveToolMergeIdis deprecated in favour ofreconcileMessages. See Chat agents. Require
ai@^7and@ai-sdk/react@^4, because Think bundles providers that return AI SDK v7 models. See Think dependencies.
Minor Changes
Require
ai@^7and@ai-sdk/react@^4, because Think bundles providers that return AI SDK v7 models. See Think dependencies.- breaking
declared scheduled tasks now run on the root agent only; override
getScheduledTasksScope()to return"all"for per-facet scheduling. See Think scheduled tasks. Browser chat turns now use the
webchannel, so its configured tools and turn limit apply. See Think channels.
Patch Changes
Report a failed agent-tool child as failed even when it was evicted before recording the failure. See Agent tools.
Fix agent-tool chunks being duplicated or dropped on reconnect, child re-attach, and fiber recovery. See Agent tools.
Add
eventDelivery: "terminal"torunAgentToolto forward only lifecycle, progress, and milestone events for a run. See Agent tools.AI Chat and Think send the terminal
doneframe after persisting and broadcasting the assistant reply, so later sends are not overwritten. See Chat agents.Keep a tool call's input when its approval request arrives before the input finishes streaming (#1872). See Human in the loop.
Fix two Think warnings that fired, or failed to fire, because of a false method-override check. See Think lifecycle hooks.
Require
agents@>=0.25.0so Think and AI Chat can import the chat helpers provided by that release.useAgentChatgainsonTurnEnd, 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.Native RPC calls to async Agent and Think methods now start lifecycle initialization first; address Agents by name because raw IDs from
newUniqueId()andidFromString()now fail their first async RPC. See Lifecycle.Stop storing compaction summaries that clients echo back, and hide duplicates already stored (#1984). See Sessions.
Context blocks can set
whenChanged: "remind"to send changes as a reminder after the cached prompt instead of rewriting it. See Context.Continuation turns that fail before streaming now report an error to clients and
onChatResponseinstead of appearing to hang (#2381). See Client tools.Messenger attachments load when
fetchDatareturns a plainArrayBuffer. See Messengers.Messenger replies now see every message in a quick burst, not just the last one. See Messengers.
Messenger replies no longer post a
...placeholder on adapters without native streaming. See Messengers.A recovered messenger turn delivers its answer to the thread instead of an "interrupted" apology. See Messengers.
rejectExecution()accepts{ autoContinue: false }to record a rejection without starting another turn. See Actions.Interfaces can now be used as
PropsonAgent,AIChatAgent,Think, and routing helpers. See Routing.- deprecated
Keep assistant messages and tool outputs attached to the correct turn when a provider reuses a
toolCallId;resolveToolMergeIdis deprecated in favour ofreconcileMessages. See Chat agents. useAgentChatkeeps messages sent while disconnected when reconnecting, including Think transcripts, instead of erasing them (#1983). See Chat agents.Fix text appearing twice when reconnecting during a tool continuation. See Resumable streaming.
onChatResponsestill fires, withrecovered: true, for a turn persisted just before a Durable Object reset (#2266, #1842). See Think lifecycle hooks.Add
session.mirror()to keep an in-memory transcript in sync with a session's change feed. See Sessions.Settle approved tool calls that never ran once the conversation moves past them, so later turns don't send unresolved tool calls (#2382). See Human in the loop.
Think can write server-authored
messageMetadataonto assistant messages, per agent or per turn, and recovery preserves metadata even when keys match built-in object properties. See Think lifecycle hooks.Recovery continuations extend the interrupted assistant message instead of adding a second one. See Think.
Resolving a paused execution removes the model's now-stale "waiting for approval" text from the transcript (#2054). See Actions.
Add
getGateway(model)to set AI Gateway options such as metadata and caching for string models (#2262). See Think.resolveModel()rejects malformed model ids up front, and@hf/...ids get the same Workers AI settings as@cf/.... See Think.Add
messengerConcurrencyto choose the Chat SDK concurrency strategy for messenger replies (#2313). See Messengers.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.
Fix regenerate continuing the old response instead of replacing it (#2028). See Multi-chat.
A regeneration interrupted by a restart now recovers on its own branch. See Multi-chat.
Older-message truncation moves in steps (
truncationStep), so the prompt-cache prefix stays stable across turns (#2200). See Think.Stream-stall recovery retries stalls before the first chunk and now calls
onChatRecovery. See Think lifecycle hooks.step.prompt()turns interrupted mid-stream now recover with their structured output instead of failing (#1727). See Workflows.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.telegramMessengeradds anativeStreamingoption and works withverifyWebhookon@chat-adapter/telegram4.38 (#2397). See Messengers.Think hooks and tools can read the running turn identity, and
activeChannelstays scoped to its owning turn. See Lifecycle hooks.Harden transient chat recovery across Think and AI Chat, including retry budgeting, cancellation, terminal error delivery, and recovery after restarts. See the
agents/chatrecovery helpers.Truncate older tool results after model conversion so
toModelOutputand provider-executed tools keep valid outputs (#2014). See Sessions.runTurn({ mode: "wait" })returns the assistant message from its own turn, even if other turns persist in the meantime. See Programmatic submissions.Wait-mode
TurnResult.outputreturns the parsed structured output, and submission inspections include the persistedmessageId(#2263, #2264). See Programmatic submissions.
- 0.19.x · maintenance
0.19.0
18 Sep 2026Add the
QueueLifecycle capability (agents/queue) for durable background work. Each pushed item is a job in the Lifecycle job queue, due immediately, run from the alarm loop one at a time in push order with Lifecycle's retry, deadman, and memory-limit policy. Callbacks are registered in the constructor and typed at declaration and push;push()accepts a stableid(upsert) and per-itemretry.Agent.queue()and friends now delegate to the capability. Queued callbacks run from the alarm loop in a fresh invocation, so they no longer see the enqueuing request'sconnectionorrequestthroughgetCurrentAgent()(the agent itself is still available). Thecf_agents_queuestable and the in-isolate drain are gone; legacy rows migrate into the job queue on the next start.queue()acceptsoptions.id;dequeue,dequeueAll,dequeueAllByCallback,getQueue, andgetQueuesare now asynchronous; andQueueItem.created_atis renamedcreatedAt.LifecycleServices.starting()is replaced bystatus(), which returns"zero" | "starting" | "started".Think's workflow-notification outbox and submission drain now run as queue items; the
cf_think_workflow_notificationstable migrates and is dropped on start.Both one-shot migrations (
cf_agents_queuesin Queue,cf_think_workflow_notificationsin Think) are temporary upgrade paths and will be removed in the next minor release, by which point every started object has migrated. Deployments skipping this release should upgrade through it. Workflow-notification delivery retries with backoff capped at ten minutes (previously five) and gives up after twelve hours of continuous failure (previously never), reporting the failure throughonError.Require
agents >=0.24.0for Think's background work, which relies on the Queue capability's stable item IDs and alarm-driven execution.Recover an interrupted Think turn that had opened its stream but persisted no content by re-running its user message instead of trying to continue it. Think opens the resumable stream row before inference, so a Durable Object reset in the window before the first chunk left a turn with a stream id, no partial, and a user message as the latest leaf; recovery classified it as
continue, found no assistant message to continue from, and marked the incidentskipped. A parent tailing such a child through agent tools then sealed the run as an error. This mirrorsAIChatAgent's empty-partial new-turn rule (#1691).
Minor Changes
Add the
QueueLifecycle capability (agents/queue) for durable background work. Each pushed item is a job in the Lifecycle job queue, due immediately, run from the alarm loop one at a time in push order with Lifecycle's retry, deadman, and memory-limit policy. Callbacks are registered in the constructor and typed at declaration and push;push()accepts a stableid(upsert) and per-itemretry.Agent.queue()and friends now delegate to the capability. Queued callbacks run from the alarm loop in a fresh invocation, so they no longer see the enqueuing request'sconnectionorrequestthroughgetCurrentAgent()(the agent itself is still available). Thecf_agents_queuestable and the in-isolate drain are gone; legacy rows migrate into the job queue on the next start.queue()acceptsoptions.id;dequeue,dequeueAll,dequeueAllByCallback,getQueue, andgetQueuesare now asynchronous; andQueueItem.created_atis renamedcreatedAt.LifecycleServices.starting()is replaced bystatus(), which returns"zero" | "starting" | "started".Think's workflow-notification outbox and submission drain now run as queue items; the
cf_think_workflow_notificationstable migrates and is dropped on start.Both one-shot migrations (
cf_agents_queuesin Queue,cf_think_workflow_notificationsin Think) are temporary upgrade paths and will be removed in the next minor release, by which point every started object has migrated. Deployments skipping this release should upgrade through it. Workflow-notification delivery retries with backoff capped at ten minutes (previously five) and gives up after twelve hours of continuous failure (previously never), reporting the failure throughonError.
Patch Changes
Require
agents >=0.24.0for Think's background work, which relies on the Queue capability's stable item IDs and alarm-driven execution.Recover an interrupted Think turn that had opened its stream but persisted no content by re-running its user message instead of trying to continue it. Think opens the resumable stream row before inference, so a Durable Object reset in the window before the first chunk left a turn with a stream id, no partial, and a user message as the latest leaf; recovery classified it as
continue, found no assistant message to continue from, and marked the incidentskipped. A parent tailing such a child through agent tools then sealed the run as an error. This mirrorsAIChatAgent's empty-partial new-turn rule (#1691).Preserve running durable submissions during startup when either a retry or continuation chat-recovery callback is still pending. This applies to both current Tasks recovery attempts and legacy scheduled callbacks, allowing interrupted empty streams to retry and complete after a restart instead of being marked as errors.
Keep recovery ownership until the successor chat turn is durably accepted, and bind the submission to that successor before handing off. Scope the handoff signal to the successor turn so concurrent turns cannot claim it, including facet-hosted turns after their legacy successor fiber is durably created. New recovery payloads carry stable submission identity; exact submission IDs take precedence over request-ID fallback, preventing collisions from recovering or terminalizing another submission. Record each turn's actual outcome and structured output on the submission row in the same transaction that settles its stream, so a restart between turn completion and ledger settlement records the completed, aborted, or errored outcome from recorded fact instead of inferring from stream state — without rerunning the turn or duplicating response callbacks: aborted turns stay aborted, recovered workflow completions keep their output, an overflow retry segment is never mistaken for an answer, and the recorded fact survives unrelated turns reclaiming stream rows.
Dependency tracking · free for 3 projects
Know when your own dependencies move
@cloudflare/think published 52 releases in the last 12 months. Inlinr folds the routine ones into a line and keeps the few that need you.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Registry facts last checked 22 Oct 2026. Releases and advisories last read 22 Oct 2026.