云端构建,一键发布智能体
为agents打分
给出您宝贵的评分:
相关产品
手机端可长按图片保存,分享到朋友圈 / 社群
使用 agents,你可以:
基于 Cloudflare 基础设施的 AI 智能体构建与部署平台,提供稳定、高效的云端智能体运行环境。
用户评论 (0)
2025年12月10日
2025年02月18日
2025年04月06日
2025年04月21日
2026年11月06日
agents@0.34.1
2026年11月26日
Patch Changes
- #3171
9448cd8Thanks @ben-reitz! - Support Pi 1.6.1 (~1.6.1). Pi tools now park with{ kind: "sleep", signals, until }instead of{ sleep: { ... } }, and a signal's state is{ kind: "value", value }or{ kind: "expired" }; a tool that still returns the old shape compiles but ends with an empty result, so update parking tools when you upgrade.agents/models/pi-ainow matches pi-ai 1.6.1: a chat-completions stream that ends withfinish_reason: "error"fails with an error the Pi harness retries under its retry settings,rawStopReasonrecords the provider's reason (with OpenRouter'snative_finish_reason), an OpenRouterstopwith no output and a failing native reason is a retryable error, andonResponsesees every response, failures included. Theagents/modelsSSE decoder reads large streamed events in linear time. See pi-durable 1.6.1's changelog and Pi harness.
@cloudflare/think@0.24.0
2026年11月20日
This release moves Think to Computer 0.10, and restarting a Think agent no longer creates a new Dynamic Worker for each extension.
Highlights
- Computer 0.10: Think's
@cloudflare/computerpeer is now^0.10.0. Computer's JavaScript backend is nowCodemodeBackend, and host modules such asws:toolsare nowcodemode:tools. See Running code withexec. - Stable extension workers:
ExtensionManagerderives each Dynamic Worker's id from a hash of the extension's code and configuration instead ofDate.now(), so restarting a Think Durable Object no longer creates, and bills, a new Dynamic Worker per extension. Extensions with a host binding can add the agent and context labels with the newworkerIdScopeoption. - Recovery: an interrupted continuation is recovered into the assistant message it continues, instead of as a duplicate message.
- Retired models: examples and messages move off the Workers AI models retired on November 20, 2026.
Upgrading
-
Update
agentsto 0.34.0 and@cloudflare/computerto^0.10.0with Think. Think now requiresagents>=0.34.0. -
Import the JavaScript backend as
CodemodeBackend:- import { WorkerJavaScriptBackend } from "@cloudflare/computer/backends/worker-javascript"; + import { CodemodeBackend } from "@cloudflare/computer/backends/codemode";
-
Rename host modules from
ws:tocodemode:, such asws:toolstocodemode:toolsandws:gittocodemode:git, in your backend'smodulesand in any code or prompts that import them. -
Check backend ids. The backend's default id is now
codemode. If anything refers to an id such asjs, update it, or pass thatidtoCodemodeBackend.
Minor Changes
- #2819
9b54e51Thanks @ben-reitz! - Think's@cloudflare/computerpeer is now^0.10.0, so upgrade Computer to 0.10 alongside Think. Its JavaScript backend is nowCodemodeBackendfrom@cloudflare/computer/backends/codemode, and host modules such asws:toolsare nowcodemode:tools. See Running code withexec.
Patch Changes
-
#2781
366d5b5Thanks @github-actions! - Fix Think recovering an interrupted continuation as a duplicate assistant message; recovery now rebuilds the message it continues. Think now requiresagents>=0.34.0. See Chat Recovery. -
#2899
1a450e7Thanks @ben-reitz! - Move off the Workers AI models retired on November 20, 2026: drop MeloTTS andwhisper-tiny-enhandling, send@cf/google/embeddinggemma-2its{ input }shape, and suggest@cf/deepseek-ai/deepseek-v4.1-flash-1017in examples and messages. See Planned model deprecations. -
#2912
81726f7Thanks @github-actions! -ExtensionManagernow derives the Dynamic Worker id from a hash of the extension's code and configuration (plus the agent and context labels for extensions with a host binding, via the newworkerIdScopeoption) instead ofDate.now(), so restarting a Think Durable Object no longer creates (and bills) a new Dynamic Worker per extension. See #2911.
agents@0.34.0
2026年11月20日
This release adds support for Pi 1.6, which lets a Pi tool wait for a person, a deadline or another session without keeping the agent awake, and lets a Pi session start from an existing history. MCP clients now say when a user needs to authorize again, and failed requests no longer send error details to the client.
Highlights
- Pi 1.6 support:
agents/harness/pi,agents/models/pi-aiand the Pi tools now run on Pi 1.6, which brings:- Tools that wait: a tool can park until a signal arrives or a deadline passes, and the agent can sleep meanwhile. Deliver signals with
harness.signal(). See Tools that wait. - Wait for a subagent:
submit()andcontinue()takenotify, so a parked tool wakes when another session's input settles. See Wait for a subagent. - Keep queued input across an abort: with
submit(input, { onAbort: "keep" }), stopping an answer doesn't drop the message the user sent next. - Steadier runs: more dropped provider connections are retried, and
PiHarness.dispose()frees pi-ai's per-session state.
- Tools that wait: a tool can park until a signal arrives or a deadline passes, and the agent can sleep meanwhile. Deliver signals with
- Start a Pi session from an existing history:
harness.root(),sessions.create()andsessions.fork()take Pi'sinit. See Seed a session with an existing history. - Anthropic message threads recover when they expire: pi-ai sends the whole conversation again as a new thread instead of failing the turn.
- MCP re-authorization: a request that needs the user to sign in again throws
MCPAuthorizationRequiredErrorwith a link, and a failed server stays failed untilreconnectMcpServer(id). See Failures and reconnecting. - Failed requests no longer leak errors: clients get a generic 500, or a 1011 close for WebSockets. Use
onFetchError()to choose the response. See Failed requests. - Chat races fixed: stop, clear, regenerate and resume now work across tabs and during recovery.
- Other changes: FLUX.2 image models in
ai.image()and pi-ai'sai.images().claudeCode()defaults toclaude-sonnet-5-5. Examples move off the retired Workers AI models. Cancelled schedules, queue items and Tasks no longer rerun.
Upgrading
You only need to make changes if you use the Pi harness, agents/models/pi-ai or the Pi tools, an MCP client, or error details in failed responses.
- Update Pi to
~1.6.0(@earendil-works/pi-durable,pi-ai,pi-schema,chord). Once a conversation runs on Pi 1.6, Pi 1.5 cannot run its tool calls or model requests, so a deployment cannot roll back past this release. Roll forward to fix a bad deploy instead. - Check pi-durable's 1.6.0 changelog if you use pi-durable directly:
RunEndTaskis nowHookTask, a tool'sexecute()may return a park,untilis optional on sleeping tasks, and code mode namespaces come fromExtension.namespace. Code that only usesPiHarnessandPiSessionneeds no changes for these. - Deliver signals with
harness.signal()rather than(await harness.pi()).signal(), which does not schedule the harness's wake first. - Call
harness.root()before reaching the root throughharness.pi(). Until the root is first used,sessions.list()leaves it out andpi.conversation(ROOT_CONVERSATION_ID)returnsundefined, and Pi's ownpi.root()would create it without the harness'sdefaults. Existing roots are unaffected. - Handle MCP re-authorization: catch
MCPAuthorizationRequiredErrorfromcallTool(),readResource()andgetPrompt()and send the user toerror.authUrl. It extendsUnauthorizedError, so existinginstanceof UnauthorizedErrorchecks still match. A failed server is no longer retried on each wake, andaddMcpServer()on one throws its recorded error, so give users a way to try again, such as a Reconnect button that callsthis.reconnectMcpServer(id). - Implement
onFetchErrorif you relied on error details in failed responses, for example to show them only in local development.
Minor Changes
-
#2832
c31b57eThanks @ben-reitz! - AddonFetchError(request, error)to Lifecycle hosts andAgent, which chooses the response when a request or WebSocket upgrade fails. See Failed requests. -
#2782
d6b4441Thanks @mattzcarey! - MCP client: requests that need the user to authorize again throwMCPAuthorizationRequiredErrorwith a link, and failed servers stayfaileduntil the newreconnectMcpServer(id). See MCP client. -
#2925
cf2ad50Thanks @ben-reitz! - Support Pi 1.6 (~1.6.0; Pi 1.5 is no longer supported).harness.signal()delivers a signal to a parked Pi tool.PiSession.submit()andcontinue()takenotify, so a parked tool can wake when another session's input settles, andsubmit()takesonAbort: "keep", so a queued input stays queued when the session is aborted.agents/models/pi-aicounts reasoning and cached tokens that a chat-completions vendor reports at the top level ofusage, as pi-ai does, and resends a conversation in full when Anthropic can no longer continue its message thread, instead of failing the turn. See pi-durable 1.6.0's changelog and Pi harness. -
#2926
6fef21dThanks @ben-reitz! -PiHarnesscreates the root session on its first use instead of when Pi opens, andharness.root({ agent, init }),sessions.create({ agent, init })andsessions.fork(from, { agent, init })take Pi'sinit, so a session can start from an existing history. See Seed a session with an existing history.
Patch Changes
-
#2832
c31b57eThanks @ben-reitz! - WhenonErrorreturns instead of throwing,AgentandAIChatAgentnow pass the original error on, instead ofundefined(or an unawaited promise whenonErroris async). -
#2861
f0f4ed9Thanks @mattzcarey! - Fix chat recovery and resume races: stop now ends a running recovery, recovery yields to a newer question, and a stale resume ACK keeps the tab waiting for the active stream's replay. -
#2860
7e2e11eThanks @mattzcarey! - Fix chat turn races across tabs: clear stops pending replies, regenerate replaces a reply still streaming, a throwingonChatMessagesends an error frame, and repeated tool results no longer re-run the model. -
#2835
5c33d89Thanks @ben-reitz! - Send a burst of messages on a sub-agent connection in one call to the parent, so resuming a sub-agent chat stream shows the partial reply at once instead of replaying it frame by frame (#2820). -
#2914
06a2715Thanks @ben-reitz! -claudeCode()now defaults toclaude-sonnet-5-5, sinceclaude-sonnet-4-5retires on November 30, 2026. -
#2895
47ccc29Thanks @ben-reitz! -DurableObjectOAuthClientProvideris now anOAuthClientProvider, and aBrowseris now aBrowserSource, in apps that compile withexactOptionalPropertyTypes. -
#2913
3d33563Thanks @ben-reitz! - ExportnormalizeCdpSpecandRawCdpProtocolfromagents/browser, so a customBrowserSourcecan build itsspec()from protocol JSON it already has. See Lower-level helpers. -
#2899
1a450e7Thanks @ben-reitz! -ai.image()and pi-ai'sai.images()now run the FLUX.2 image models (@cf/black-forest-labs/flux-2-klein-9b,flux-2-klein-4b,flux-2-dev), sending their multipart input and up to four reference images. -
#2858
5071d3cThanks @mattzcarey! - A schedule or queue item that is cancelled or replaced while its callback waits to retry no longer runs again with the old job. This also holds for sub-agent schedules and queue items, and when a second alarm invocation picks up the replacement. -
#2829
88eb62cThanks @github-actions! -Lifecycle.fetchno longer sends an error's stack to the client when startup or a request handler throws. HTTP requests get a genericInternal Server Errorbody and WebSocket upgrades close with 1011 without an error frame. The full error is still logged. See #2828. -
#2827
e0f95e5Thanks @mattzcarey! - TypeLifecycleCapability.onStart()as returningMaybePromise<void>to match the runner, which awaits it. See Agents. -
#2863
46daba4Thanks @mattzcarey! - Fix MCP client races found by TLA+ model checking: a pending step-up link survives a token refresh, a refresh no longer overwrites a step-up grant, a removed server's tokens stay deleted, a sign-in survivescloseConnection(), an old link no longer fails a server added again, overlapping closes and removals leave a server added again alone,addMcpServer(..., { id })returns a link that works and renames the server in one transaction, configuring elicitation handlers while a server connects no longer fails it and is advertised, step-up rounds count for the scope set of the link that was completed, and a declined sign-in after a refused refresh is recorded as failed (see re-authorization during a session). -
#2856
cff5dd1Thanks @mattzcarey! - An MCP server removed and added again under the same id while it was still connecting now starts clean. The removed server's connect no longer marks the new one failed ("was removed while connecting"), and its retries no longer connect the new one a second time. With a customcreateAuthProvider,removeMcpServer()no longer deletes the stored row of a server added again while it cleared credentials. -
#2899
1a450e7Thanks @ben-reitz! - Suggest@cf/deepseek-ai/deepseek-v4.1-flash-1017instead of@cf/zai-org/glm-4.7-flashin the unknown-model error and doc comments. -
#2781
366d5b5Thanks @github-actions! - Fix Think recovering an interrupted continuation as a duplicate assistant message; recovery now rebuilds the message it continues. Think now requiresagents>=0.34.0. See Chat Recovery. -
#2807
1f3bd92Thanks @ben-reitz! - The piweb_searchandweb_fetchtools give code mode scripts their results as objects. -
#2899
1a450e7Thanks @ben-reitz! - Move off the Workers AI models retired on November 20, 2026: drop MeloTTS andwhisper-tiny-enhandling, send@cf/google/embeddinggemma-2its{ input }shape, and suggest@cf/deepseek-ai/deepseek-v4.1-flash-1017in examples and messages. See Planned model deprecations. -
#2859
f41f395Thanks @mattzcarey! - A Task run cancelled while its attempt is still being claimed no longer starts its handler. -
#2867
0f2727aThanks @mattzcarey! - Stop running client messages on a WebSocket the host has closed. A connection rejected fromonConnectwithconnection.close()could still run one@callablemethod, state update, oronMessagecall. The close happens before the client has the upgrade response, so anything the client sent as soon as it connected arrived after the close, and the platform still delivered it.Connection.close()now records the close in the socket attachment, so the record survives hibernation, and theWebSocketscapability drops every later message on both the hibernating and Cap'n Web wires. Messages the client sent before closing the connection itself still run.
@cloudflare/ai-chat@0.12.3
2026年11月20日
This release fixes chat races across tabs and during recovery, so stop, clear, regenerate and resume do what the user asked even while another tab or a recovery is streaming. A chat request cancelled while it waits in the queue no longer runs, and when onError returns instead of throwing, AIChatAgent passes the original error on. No changes are needed to upgrade.
Patch Changes
-
#2832
c31b57eThanks @ben-reitz! - WhenonErrorreturns instead of throwing,AgentandAIChatAgentnow pass the original error on, instead ofundefined(or an unawaited promise whenonErroris async). -
#2818
a2f1216Thanks @ben-reitz! - Cancelling a chat request while it waits in the queue now stops it from running, instead of the cancel being dropped. See #2701. -
#2861
f0f4ed9Thanks @mattzcarey! - Fix chat recovery and resume races: stop now ends a running recovery, recovery yields to a newer question, and a stale resume ACK keeps the tab waiting for the active stream's replay. -
#2860
7e2e11eThanks @mattzcarey! - Fix chat turn races across tabs: clear stops pending replies, regenerate replaces a reply still streaming, a throwingonChatMessagesends an error frame, and repeated tool results no longer re-run the model.
agents@0.33.0
2026年11月03日
This release adds support for Pi 1.5, which makes PiHarness much faster and lighter on memory, and lets you continue a run that ended without an answer.
Highlights
- Pi 1.5 support:
agents/harness/pi,agents/models/pi-aiand the Pi tools now run on Pi 1.5. - Far fewer storage writes while streaming: Pi stores streamed answers and tool output in batches, at the latest every second, instead of on every update. Over SQLite this cuts storage transactions about 27x for long answers and 5.7x for turns with parallel tools, and CPU by about a quarter. A crash can now lose up to about a second of streamed output.
- Faster with many sessions: Pi's scheduler no longer rechecks every conversation on each commit, so on SQLite one Pi harness with 2,048 sessions went from 88 to 459 agent runs per second. Commits that arrive together now share one storage call, and a normal run makes no storage reads.
- Large answers no longer blow up memory: streaming a 500 KB tool call used to take about 20 s of CPU and a 100 MB heap, and a 140 KB answer followed by a 140 KB tool call held over 100 MB. Pi now appends new text instead of copying it on every update.
- Conversation view:
session.watch()replacessession.events(). It returns the newest transcript entries and the session's live state, such as the answer being streamed, running tools, and why the last run ended without an answer.session.entries()pages older entries. See Work with sessions. - Continue a run:
session.continue()starts a run on the transcript as it is, without a new message, for example after the model errored or the run hit its turn limit. - Turn limit:
defaults.maxTurnscaps the tool rounds a run can take in new sessions. A run that reaches it ends without an answer, with reasonturn_limit. - Crash-looping tasks end instead of parking: a tool call cut off by Pi's restart limit ends with an error result the model sees, and a model request ends its run without an answer, with reason
restart_limit. See How recovery works. - Other changes:
submit()takeswhenIdle: "reject", so an idle session refuses input instead of starting a run. Streamed tool-call arguments on the chat-completions wire that aren't valid JSON now fail the tool call with an error the model can fix. In Pi's code mode,browserToolgives scripts its run as an object, with screenshots as image blocks forimage().browserToolstops when the harness aborts its call, andBrowserSessionlets code outsidebrowserToolrun the samebrowserobject.useAgentChat().stop()now cancels server-started turns streamed without a resume handshake.
Upgrading
You only need to make changes if you use the Pi harness, agents/models/pi-ai or the Pi tools.
-
Update Pi to
~1.5.0(@earendil-works/pi-durable,pi-ai,chord) and install@earendil-works/pi-schemaalongside them. Once a conversation runs on Pi 1.5, Pi 1.4 cannot read it, so a deployment cannot roll back past this release. Roll forward to fix a bad deploy instead. -
Check pi-durable's 1.5.0 changelog for its breaking changes, such as the removal of
watchEvents(), tagged watch calls and ends, andConversationView.entriesbecoming a window over the transcript. -
Replace
session.events()withsession.watch()and render the view each time it changes. To show a transcript longer than the window, merge each value into Pi'sConversationTranscript, which pages older entries withsession.entries(). The view's entries now include those before a reset or compaction: Pi adds the reset or summary in place instead of cutting the transcript there. An idlepi.livenow keepsrunFailureafter a failed run, so checkrun === undefinedinstead of comparing it with{}.- const stream = await session.events(); - initialize(stream.snapshot); - stream.start(async (events) => events.forEach(apply)); + const watch = await session.watch(); + render(watch.value); + watch.start(async (call) => { + if (call.kind === "value") render(call.value); + });
-
Build your Pi tool schemas with
@earendil-works/pi-schema, as pi-ai no longer exports TypeBox'sType. UnlikeType.Object,obj()rejects properties it doesn't list; pass{ open: true }to allow them. To keep TypeBox instead, importTypefromtypebox.- import { Type } from "@earendil-works/pi-ai"; - const WordCount = Type.Object({ text: Type.String() }); + import { obj, str } from "@earendil-works/pi-schema"; + const WordCount = obj({ text: str() });
-
Remove calls to
retry()and handling of theparkedstatus. To run work again after a run ended without an answer, callsession.continue()or submit it again. -
Update your
onReportcallback if you pass one toHarness.open. It now takes one report tagged bykind, with the error on it.session_failedis nowstorage_failed, and a task the restart limit ends is reported astask_interruptedinstead oftask_parked.
Minor Changes
-
#2796
edf1b52Thanks @ben-reitz! - Support Pi 1.5 (~1.5.0; Pi 1.4 is no longer supported):session.watch()replacessession.events()and returns Pi's conversation view,session.entries()pages the transcript,retry()and theparkedpending status are removed as Pi now ends crash-looping tasks,submit()takeswhenIdle: "reject", and the Pi tools build their schemas with@earendil-works/pi-schema, a new optional peer, as pi-ai no longer exports TypeBox'sType. See pi-durable 1.5.0's changelog. -
#2797
77138faThanks @ben-reitz! - Two new controls for the Pi harness, from Pi 1.5:continue()starts a run without sending a new message. Use it to try again after a run ended without an answer, for example because the model errored or the run hit its turn limit.defaults.maxTurnslimits how many tool rounds a run can take. A run that reaches it ends without an answer, with reasonturn_limit.
See Pi harness.
Patch Changes
-
#2795
3e21ee4Thanks @ben-reitz! - AddBrowser.functionDocs(),BrowserSession.functions, reportnotices, opt-in scope locks (browser.session({ lock: true }),session.lock()) andconversationScope()toagents/browser, so code outsidebrowserToolcan run the samebrowserobject. See Browse the Web. -
#2795
3e21ee4Thanks @ben-reitz! -browserToolstops when the harness aborts its call, for pi, the AI SDK and TanStack AI. See Browse the Web. -
#2798
62ccd87Thanks @ben-reitz! - Pi models on the chat-completions wire (Workers AI, and OpenAI-compatible models through AI Gateway) now parse streamed tool-call arguments with pi-ai's own parser. When a model sends arguments that aren't valid JSON, the tool call now fails with an error the model can see and fix, instead of running with whatever arguments could be salvaged.See Models for pi-ai.
-
#2801
748e693Thanks @ben-reitz! - The pibrowserToolgives code mode scripts the run as an object, with screenshots as image blocks forimage(). See Browse the Web. -
#2805
baf26bcThanks @ben-reitz! -useAgentChat().stop()now cancels server-started turns streamed without a resume handshake. See Request cancellation.
@cloudflare/think@0.23.0
2026年10月30日
Minor Changes
- #2771
54ae3e8Thanks @mattzcarey! - Breaking: Think reloadsgetSkills()sources every turn, soskills.workspace(this.workspace)picks up skills written to/workspace/.agents/skills; an overriddengetSystemPrompt()now always renders above context blocks instead of being dropped once any block exists; skill catalog changes reach the model as a context reminder rather than rebuilding the cached system prompt;skillWorkspaceand the extension"skill"context block type are removed. See Agent Skills.
@cloudflare/codemode@0.5.6
2026年10月30日
Patch Changes
- #2766
b372289Thanks @github-actions! - Allow@tanstack/ai1.x in the optional peer dependency ranges, and type the TanStack AI tools so they compile against both 0.x and 1.x. See TanStack AI.
agents@0.32.0
2026年10月30日
Minor Changes
-
#2752
34cbd30Thanks @mattzcarey! - Addexperimental_registerOpenTelemetry()toagents/observability, which records spans from OpenTelemetry-instrumented libraries as Workers trace spans. Experimental and subject to change. -
#2771
54ae3e8Thanks @mattzcarey! - Breaking:agents/skillsnow loads Agent Skills from Computer Workspace files (workspace()), R2 (r2()), or code (manifest()), checksSKILL.mdagainst the Agent Skills spec, and replacesSkillRegistrywithloadSkillCatalog()andcreateSkillTools()(fromagents/skills/tools/ai-sdk);parseSkill()follows the spec's guide for agents, loading skills that break a rule with warnings;runner()moved toagents/skills/runner; theagents:skillsVite import andagents/skills/compileare removed. See Agent Skills.
Patch Changes
-
#2763
df85805Thanks @mattzcarey! - Agents SDK spans (agent lifecycle,wrapAISDK, Think) now set span statuserroron failure, where the Workers runtime supportsSpan.setStatus(); attributes are unchanged. See Observability. -
#2737
08747d9Thanks @mattzcarey! - Mark the package side-effect free (apart from the CLI), so bundlers drop the modules a Worker doesn't use.import { routeAgentRequest } from "agents"no longer bundles the MCP client. -
#2744
a2d371eThanks @mattzcarey! - Update@modelcontextprotocol/clientand@modelcontextprotocol/serverto 2.4.0 and@modelcontextprotocol/sdkto 1.32.2, and add aclientMetadataUrloption toDurableObjectOAuthClientProviderfor OAuth Client ID Metadata Documents. See MCP client. -
#2740
8cf6da1Thanks @mattzcarey! -agents/models/pi-aiparses streamed chat-completions tool-call arguments incrementally, instead of re-parsing the whole argument text on every delta. -
#2766
b372289Thanks @github-actions! - Allow@tanstack/ai1.x in the optional peer dependency ranges, and type the TanStack AI tools so they compile against both 0.x and 1.x. See TanStack AI.
@cloudflare/think@0.22.0
2026年10月27日
Minor Changes
- #2632
361046eThanks @mattzcarey! - RemovelazyWorkspace, exported by mistake in 0.21.0. UsegetWorkspace(() => stub)from@cloudflare/computerinstead. Think's@cloudflare/computerpeer is now^0.8.0, so upgrade Computer to 0.8 alongside Think. See Multi-session chat.
Patch Changes
- #2678
325c6caThanks @github-actions! - Fix theaipeer dependency version in the Think README; see Think dependencies.
agents@0.31.0
2026年10月27日
This release adds internal hostnames to the browser. Give a Browser Run browser hostnames such as preview.internal, and its requests to them go to your agent instead of the internet, so the model can open a dev server, a workspace folder or another Worker in the same browser it uses for the web.
Highlights
- Internal hostnames: pass up to 8 hostnames to
browserRun()asinternalHosts. Serve each one from afetchfunction on your agent or from another Worker. See Internal hostnames. - Hosts the model points: give a host a
targetschema, and the model chooses what it serves withbrowser.assignHost(), such as a container port or a folder in its workspace. Without a target, a host always serves the same thing. - Lighter installs without MCP servers:
@modelcontextprotocol/sdkand@modelcontextprotocol/serverare now optional peer dependencies, so apps that don't serve MCP no longer install them. - Stable models:
agents/models/ai-sdkandagents/models/pi-aiare no longer experimental. See Models. - Other changes:
createMcpHandlerpasses the verified token from@cloudflare/workers-oauth-provider1.x to tool callbacks ascontext.http.authInfo.createAIfromagents/models/pi-aisends pi-ai's Anthropic betas for catalog Claude models.PiWhenBusyaccepts"reject". browserToolimprovements: the model's code runs in its own Dynamic Worker instead of on codemode, and is stopped from outside that Worker if it overruns its timeout. It can no longer close the browser or create a Live View link.this.browser.session()lets your own code drive the same browser.createBrowserTools,createBrowserRuntime,BrowserConnectorand the Quick Action helpers are deprecated in favour ofbrowserTool.
Upgrading
You only need to make changes if you serve MCP or use browserTool.
If you serve MCP or use agents/x402 or agents/experimental/webmcp:
-
Add the MCP packages to your
package.jsonat the versions this release expects, since your package manager no longer installs them. Until you do, builds fail with an unresolved import.agents/mcp(McpAgent,WorkerTransport,createLegacyMcpHandler) andagents/x402:@modelcontextprotocol/sdk@1.32.1and@modelcontextprotocol/server@2.3.1agents/mcp/server(createMcpHandler):@modelcontextprotocol/server@2.3.1agents/experimental/webmcp:@modelcontextprotocol/sdk@1.32.1
-
Import client helpers such as
RPCClientTransportfromagents/mcp/clientinstead ofagents/mcp. MCP client code needs neither package.
If you use browserTool:
-
Remove the
CodemodeRuntimeexport from your Worker unlesscreateBrowserToolsstill uses it, and removectxfrombrowserTool's options. Keep theLOADERbinding and keep@cloudflare/codemodeinstalled for now. -
Update instructions of your own that mention
cdp.send, such as a system prompt. The tool's description already teaches the new call:- await cdp.send({ method: "Page.navigate", params: { url }, sessionId: "active" }); + await browser.cdp({ method: "Page.navigate", params: { url }, sessionId: "active" });
-
Read
noticeinstead ofrestarted,newTabsandcallsif your code inspects results.noticesays in sentences whether the browser restarted, the page opened tabs, or another chat closed or shares the tab.PiBrowserToolDetailsnow has onlyexecutionIdandstatus.
Minor Changes
-
#2673
865a57eThanks @ben-reitz! - AddinternalHoststobrowserRun()provider: set internal hostnames the browser can reach through your agent. Allow the model to point these hostnames at specific targets like container ports or workspace folders withbrowser.assignHost(). See Internal hostnames. -
#2667
03b4609Thanks @ben-reitz! -browserToolnow runs the model's code in its own Dynamic Worker instead of on codemode, so it needs noctxorCodemodeRuntimeexport (keep@cloudflare/codemodeinstalled for now) and its output has nocallslog;browser.session()gives your own code the same connection to the browser. See Persistent browser. -
#2634
565e37cThanks @mattzcarey! -@modelcontextprotocol/sdkand@modelcontextprotocol/serverare now optional peer dependencies, so add them to yourpackage.jsonif you useagents/mcp,agents/mcp/server,agents/x402oragents/experimental/webmcp. See Upgrading an existingMcpAgentserver.
Patch Changes
-
#2668
183c141Thanks @ben-reitz! -browserTool's model code now calls abrowserglobal (browser.cdp(...),browser.spec({ domain })) instead ofcdp.send(...), and the result'snoticereplaces therestartedandnewTabsfields. See Persistent browser. -
#2666
57c7813Thanks @ben-reitz! -createBrowserTools,createBrowserRuntimeandBrowserConnectorare deprecated; usebrowserTool. See Persistent browser. The Quick Action helpers (createQuickActionTools,runQuickAction,browserMarkdownand the rest) are deprecated too and will not change. -
#2743
f049ee1Thanks @mattzcarey! -agents/models/ai-sdkandagents/models/pi-aiare no longer experimental. See Models. -
#2718
916c0e3Thanks @ben-reitz! -createAIfromagents/models/pi-ainow sends pi-ai'sbetasas theanthropic-betaheader for catalog Claude models on/run, as it already did on the provider-native path. See #2714. -
#2717
4d7734aThanks @ben-reitz! -PiWhenBusyaccepts"reject", whichPiHarness.submit()already passed through to pi-durable. See Pi harness. -
#2680
2a25d88Thanks @mattzcarey! -createMcpHandlernow reads the verified token that@cloudflare/workers-oauth-provider1.x sets asctx.auth, so tool callbacks receivecontext.http.authInfo(token, client ID, scopes, expiry and resource) behindOAuthProviderandOAuthResourceServer.getMcpAuthContext().propsis unchanged.