Minor Changes
-
#848
a167344Thanks @mattzcarey! - Upgrade MCP SDK to 1.26.0 to prevent cross-client response leakage. Updated examples for stateless MCP Servers create newMcpServerinstance per request instead of sharing a single instance. A guard is added in this version of the MCP SDK which will prevent connection to a Server instance that has already been connected to a transport. Developers will need to modify their code if they declare theirMcpServerinstance as a global variable. -
#298
27f4e3eThanks @jaredhanson! - AddcreateMcpOAuthProvidermethod to theAgentclass, allowing subclasses to override the default OAuth provider used when connecting to MCP servers. This enables custom authentication strategies such as pre-registered client credentials or mTLS, beyond the built-in dynamic client registration. -
#610
f59f305Thanks @threepointone! - DeprecateonStateUpdateserver-side hook in favor ofonStateChangedonStateChangedis a drop-in rename ofonStateUpdate(same signature, same behavior)onStateUpdatestill works but emits a one-time console warning per class- Throws if a class overrides both hooks simultaneously
validateStateChangerejections now propagate aCF_AGENT_STATE_ERRORmessage back to the client
-
#871
27f8f75Thanks @threepointone! - Migrate x402 MCP integration from legacyx402package to@x402/coreand@x402/evmv2Breaking changes for x402 users:
- Peer dependencies changed: replace
x402with@x402/coreand@x402/evm PaymentRequirementstype now uses v2 fields (e.g.amountinstead ofmaxAmountRequired)X402ClientConfig.accounttype changed fromviem.AccounttoClientEvmSigner(structurally compatible withprivateKeyToAccount())
Migration guide:
-
Update dependencies:
npm uninstall x402 npm install @x402/core @x402/evm
-
Update network identifiers — both legacy names and CAIP-2 format are accepted:
// Before { network: "base-sepolia"; } // After (either works) { network: "base-sepolia"; } // legacy name, auto-converted { network: "eip155:84532"; } // CAIP-2 format (preferred)
-
If you access
PaymentRequirementsfields in callbacks, update to v2 field names (see@x402/coredocs). -
The
versionfield onX402ConfigandX402ClientConfigis now deprecated and ignored — the protocol version is determined automatically.
Other changes:
X402ClientConfig.networkis now optional — the client auto-selects from available payment requirements- Server-side lazy initialization: facilitator connection is deferred until the first paid tool invocation
- Payment tokens support both v2 (
PAYMENT-SIGNATURE) and v1 (X-PAYMENT) HTTP headers - Added
normalizeNetworkexport for converting legacy network names to CAIP-2 format - Re-exports
PaymentRequirements,PaymentRequired,Network,FacilitatorConfig, andClientEvmSignerfromagents/x402
- Peer dependencies changed: replace
Patch Changes
-
#610
f59f305Thanks @threepointone! - Add readonly connections: restrict WebSocket clients from modifying agent state- New hooks:
shouldConnectionBeReadonly,setConnectionReadonly,isConnectionReadonly - Blocks both client-side
setState()and mutating@callable()methods for readonly connections - Readonly flag stored in a namespaced connection attachment (
_cf_readonly), surviving hibernation without extra SQL - Connection state wrapping hides the internal flag from user code and preserves it across
connection.setState()calls - Client-side
onStateUpdateErrorcallback for handling rejected state updates
- New hooks:
-
#855
271a3cfThanks @threepointone! - FixuseAgentandAgentClientcrashing when usingbasePathrouting. -
#868
b3e2dc1Thanks @threepointone! - Fix MCP OAuth callback URL leaking instance nameAdd
callbackPathoption toaddMcpServerto prevent instance name leakage in MCP OAuth callback URLs. WhensendIdentityOnConnectisfalse,callbackPathis now required — the default callback URL would expose the instance name, undermining the security intent. Also fixes callback request detection to match via thestateparameter instead of a loose/callbackURL substring check, enabling custom callback paths. -
#872
de71f9eThanks @threepointone! - update dependencies -
8893fbeThanks @threepointone! - partykit releasespartyserver
0.1.3(Feb 8, 2026)- #319 — Add
configurable: trueto thestate,setState,serializeAttachment, anddeserializeAttachmentproperty descriptors on connection objects. This allows downstream consumers (like the Cloudflare Agents SDK) to redefine these properties withObject.definePropertyfor namespacing or wrapping internal state storage. Default behavior is unchanged.
0.1.4(Feb 9, 2026)- #320 — Add CORS support to
routePartykitRequest. Passcors: truefor permissive defaults orcors: { ...headers }for custom CORS headers. Preflight (OPTIONS) requests are handled automatically for matched routes, and CORS headers are appended to all non-WebSocket responses — including responses returned byonBeforeRequest. - #260 — Remove redundant initialize code as
setNametakes care of it, along with the nestedblockConcurrencyWhilecall.
partysocket
1.1.12(Feb 8, 2026)- #317 — Fix
PartySocket.reconnect()crashing when usingbasePathwithoutroom. The reconnect guard now accepts eitherroomorbasePathas sufficient context to construct a connection URL. - #319 — Throw a clear error when constructing a
PartySocketwithoutroomorbasePath(and withoutstartClosed: true), instead of silently connecting to a malformed URL containing"undefined"as the room name.
1.1.13(Feb 9, 2026)- #322 — Fix
reconnect()not working aftermaxRetrieshas been exhausted. The_connectLockwas not released when the max retries early return was hit in_connect(), preventing any subsequentreconnect()call from initiating a new connection.
- #319 — Add
-
#869
fc17506Thanks @threepointone! - Removeroom/partyworkaround forbasePathrouting now that partysocket handles reconnect without requiringroomto be set. -
#873
d0579faThanks @threepointone! - Remove CORS wrapping fromrouteAgentRequestand delegate to partyserver's native CORS support. Thecorsoption is now passed directly through toroutePartykitRequest, which handles preflight and response headers automatically since partyserver 0.1.4. -
#865
c3211d0Thanks @threepointone! - update dependencies -
Updated dependencies [
21a7977,3de98a3,c3211d0]:- @cloudflare/codemode@0.0.7
- @cloudflare/ai-chat@0.0.7