Version Packages#902
Merged
Merged
Conversation
github-actions
Bot
force-pushed
the
changeset-release/main
branch
17 times, most recently
from
February 16, 2026 08:14
e945e91 to
9af320e
Compare
github-actions
Bot
force-pushed
the
changeset-release/main
branch
4 times, most recently
from
February 17, 2026 10:38
ffcb1e4 to
abf2bdd
Compare
github-actions
Bot
force-pushed
the
changeset-release/main
branch
from
February 17, 2026 11:22
abf2bdd to
13b8572
Compare
Add release notes for packages/agents (0.5.0) and packages/ai-chat (0.1.0). agents: document per-connection protocol message control, built-in retry system (this.retry and per-task retry options with exponential backoff and jitter), improved scheduling ergonomics, discriminated union schema cleanup, and fixes for hibernation, deep type recursion, and SSE keepalives. ai-chat: announce first minor release of @cloudflare/ai-chat, refactor internals (ResumableStream, WebSocket ChatTransport, simplified SSE parsing), streaming and persistence bug fixes, and new features such as maxPersistedMessages, body for custom request data, row size protection, incremental persistence, data parts, persisted tool approval, DO-hibernation-resilient client tools, and autoContinueAfterToolResult defaulting to true.
commit: |
taowen
pushed a commit
to taowen/agents
that referenced
this pull request
Feb 17, 2026
* Version Packages * Update CHANGELOGs for agents and ai-chat Add release notes for packages/agents (0.5.0) and packages/ai-chat (0.1.0). agents: document per-connection protocol message control, built-in retry system (this.retry and per-task retry options with exponential backoff and jitter), improved scheduling ergonomics, discriminated union schema cleanup, and fixes for hibernation, deep type recursion, and SSE keepalives. ai-chat: announce first minor release of @cloudflare/ai-chat, refactor internals (ResumableStream, WebSocket ChatTransport, simplified SSE parsing), streaming and persistence bug fixes, and new features such as maxPersistedMessages, body for custom request data, row size protection, incremental persistence, data parts, persisted tool approval, DO-hibernation-resilient client tools, and autoContinueAfterToolResult defaulting to true. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Sunil Pai <spai@cloudflare.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
agents@0.5.0
Minor Changes
#920
4dea3bdThanks @threepointone! - AddshouldSendProtocolMessageshook andisConnectionProtocolEnabledpredicate for per-connection control of protocol text framesAdds the ability to suppress protocol messages (
CF_AGENT_IDENTITY,CF_AGENT_STATE,CF_AGENT_MCP_SERVERS) on a per-connection basis. This is useful for binary-only clients (e.g. MQTT devices) that cannot handle JSON text frames.Override
shouldSendProtocolMessages(connection, ctx)to returnfalsefor connections that should not receive protocol messages. These connections still fully participate in RPC and regular messaging — only the automatic protocol text frames are suppressed, both on connect and during broadcasts.Use
isConnectionProtocolEnabled(connection)to check a connection's protocol status at any time.Also fixes
isConnectionReadonlyto correctly survive Durable Object hibernation by re-wrapping the connection when the in-memory accessor cache has been cleared.#874
a6ec9b0Thanks @threepointone! - Add retry utilities:this.retry(), per-task retry options, andRetryOptionstypethis.retry(fn, options?)— retry any async operation with exponential backoff and jitter. Accepts optionalshouldRetrypredicate to bail early on non-retryable errors.queue(),schedule(),scheduleEvery()accept{ retry?: RetryOptions }for per-task retry configuration, persisted in SQLite alongside the task.addMcpServer()accepts{ retry?: RetryOptions }for configurable MCP connection retries.RetryOptionstype is exported for TypeScript consumers.static options = { retry: { ... } }— override defaults for an entire agent class.terminateWorkflow,pauseWorkflow, etc.) with Durable Object-aware error detection.Patch Changes
#899
04c6411Thanks @threepointone! - Fix React hooks exhaustive-deps warning in useAgent by referencing cacheInvalidatedAt inside useMemo body.#904
d611b94Thanks @ask-bonk! - Fix TypeScript "excessively deep" error with deeply nested state typesAdd a depth counter to
CanSerializeandIsSerializableParamtypes that bails out totrueafter 10 levels of recursion. This prevents the "Type instantiation is excessively deep and possibly infinite" error when using deeply nested types like AI SDKCoreMessage[]as agent state.#911
67b1601Thanks @threepointone! - Update all dependencies and fix breaking changes.Update all dependencies, add required
aria-labelprops to KumoButtoncomponents withshape(now required for accessibility), and fix state test for constructor-time validation of conflictingonStateChanged/onStateUpdatehooks.#889
9100e65Thanks @deathbyknowledge! - Fix scheduling schema compatibility with zod v3 and improve schema structure.zod/v3import tozodso the package works for users on zod v3 (who don't have thezod/v3subpath).z.discriminatedUniononwhen.type. Each scheduling variant now only contains the fields it needs, making the schema cleaner and easier for LLMs to follow.z.coerce.date()withz.string(). Zod v4'stoJSONSchema()cannot representDate, and the AI SDK routes zod v4 schemas through it directly. Dates are now returned as ISO 8601 strings.Schedule["when"]is now a discriminated union instead of a flat object with optional fields.when.dateisstringinstead ofDate.#916
24e16e0Thanks @threepointone! - Widen peer dependency ranges across packages to prevent cascading major bumps during 0.x minor releases. Mark@cloudflare/ai-chatand@cloudflare/codemodeas optional peer dependencies ofagentsto fix unmet peer dependency warnings during installation.#898
cd2d34fThanks @jvg123! - Add keepalive ping to POST SSE response streams in WorkerTransportThe GET SSE handler already sends
event: pingevery 30 seconds to keep the connection alive, but the POST SSE handler did not. This caused POST response streams to be silently dropped by proxies and infrastructure during long-running tool calls (e.g., MCP tools/call), resulting in clients never receiving the response.#874
a6ec9b0Thanks @threepointone! - Make queue and schedule getter methods synchronousgetQueue(),getQueues(),getSchedule(),dequeue(),dequeueAll(), anddequeueAllByCallback()were unnecessarilyasyncdespite only performing synchronous SQL operations. They now return values directly instead of wrapping them in Promises. This is backward compatible — existing code usingawaiton these methods will continue to work.@cloudflare/ai-chat@0.1.0
Minor Changes
#899
04c6411Thanks @threepointone! - Refactor AIChatAgent: extract ResumableStream class, add WebSocket ChatTransport, simplify SSE parsing.Bug fixes:
setMessagesfunctional updater sending empty array to server_sendPlaintextReplycreating multiple text parts instead of oneCF_AGENT_MESSAGE_UPDATEDnot broadcast for streaming messages_streamCompletionPromisenot resolved on error (tool continuations could hang)bodylost during tool continuations (now preserved alongsideclientTools)clearAll()not clearing in-memory chunk buffer (orphaned chunks could flush after clear)reasoning-deltasilently dropping data whenreasoning-startwas missed (stream resumption)string.lengthinstead of UTF-8 byte count for SQLite limitscompletedguard on abort listener to prevent redundant cancel after stream completionNew features:
maxPersistedMessages— cap SQLite message storage with automatic oldest-message deletionbodyoption onuseAgentChat— send custom data with every request (static or dynamic)onFinishis now optional — framework handles abort controller cleanup and observabilityDocs:
docs/chat-agents.md— comprehensive AIChatAgent and useAgentChat referenceexamples/ai-chat/example with modern patterns and Workers AIDeprecations (with console.warn):
createToolsFromClientSchemas(),extractClientToolSchemas(),detectToolsRequiringConfirmation()tools,toolsRequiringConfirmation,experimental_automaticToolResolutionoptionsaddToolResult()(useaddToolOutput())#919
6b6497cThanks @threepointone! - ChangeautoContinueAfterToolResultdefault fromfalsetotrue.Client-side tool results and tool approvals now automatically trigger a server continuation by default, matching the behavior of server-executed tools (which auto-continue via
streamText's multi-step). This eliminates the most common setup friction with client tools — the LLM now responds after receiving tool results without requiring explicit opt-in.To restore the previous behavior, set
autoContinueAfterToolResult: falseinuseAgentChat.Patch Changes
#900
16b2dcaThanks @deathbyknowledge! - Add support fordata-*stream parts (developer-defined typed JSON blobs) in the shared message builder and client hook.Data part handling:
applyChunkToPartsnow handlesdata-*prefixed chunk types, covering both server persistence and client reconstruction (stream resume, cross-tab broadcast). Transient parts (transient: true) are broadcast to connected clients but excluded frommessage.partsand SQLite persistence. Non-transient parts support reconciliation by type+id — a second chunk with the same type and id updates the existing part's data in-place instead of appending a duplicate.onDatacallback forwarding:useAgentChatnow invokes theonDatacallback fordata-*chunks on the stream resumption and cross-tab broadcast codepaths, which bypass the AI SDK's internal pipeline. For new messages sent via the transport, the AI SDK already invokesonDatainternally. This is the correct way to consume transient data parts on the client since they are not added tomessage.parts.#922
c8e5244Thanks @threepointone! - Fix tool approval UI not surviving page refresh, and fix invalid prompt error after approvaltool-approval-requestandtool-output-deniedstream chunks in the server-side message builder. Previously these were only handled client-side, so the server never transitioned tool parts toapproval-requestedoroutput-deniedstate.approval-requestedstate. The stream is paused waiting for user approval, so this is a natural persistence point. Without this, refreshing the page would reload from SQLite where the tool was still ininput-availablestate, showing "Running..." instead of the Approve/Reject UI._applyToolApprovalto merge with existing approval data instead of replacing it. Previouslyapproval: { approved }would overwrite the entire object, losing theidfield thatconvertToModelMessagesneeds to produce a validtool-approval-requestcontent part. This caused anInvalidPromptErroron the continuation stream after approval.#897
994a808Thanks @alexanderjacobsen! - Fix client tool schemas lost after DO restart by re-sending them with CF_AGENT_TOOL_RESULT#916
24e16e0Thanks @threepointone! - Widen peer dependency ranges across packages to prevent cascading major bumps during 0.x minor releases. Mark@cloudflare/ai-chatand@cloudflare/codemodeas optional peer dependencies ofagentsto fix unmet peer dependency warnings during installation.#912
baa87ccThanks @threepointone! - Persist request context across Durable Object hibernation.Persist
_lastBodyand_lastClientToolsto SQLite so custom body fields and client tool schemas survive Durable Object hibernation during tool continuation flows (issue ai-chat: forward or document body behavior during tool continuation path #887). Add test coverage for body forwarding during tool auto-continuation, and update JSDoc forOnChatMessageOptions.bodyto document tool continuation and hibernation behavior.#913
bc91c9aThanks @threepointone! - Sync_lastClientToolscache and SQLite when client tools arrive viaCF_AGENT_TOOL_RESULT, and align the wire type withClientToolSchema(JSONSchema7instead ofRecord<string, unknown>)#919
6b6497cThanks @threepointone! - Add auto-continuation support for tool approval (needsApproval).When a tool with
needsApproval: trueis approved viaCF_AGENT_TOOL_APPROVAL, the server can now automatically continue the conversation (matching the existingautoContinuebehavior ofCF_AGENT_TOOL_RESULT). The client hook passesautoContinuewith approval messages whenautoContinueAfterToolResultis enabled. Also fixes silent data loss wheretool-output-availableevents for tool calls in previous assistant messages were dropped during continuation streams by adding a cross-message fallback search in_streamSSEReply.#910
a668155Thanks @threepointone! - Add structural message validation and fix message metadata on broadcast/resume path.Structural message validation:
Messages loaded from SQLite are now validated for required structure (non-empty
idstring, validrole,partsis an array). Malformed rows — from corruption, manual tampering, or schema drift — are logged with a warning and silently skipped instead of crashing the agent. This is intentionally lenient: emptypartsarrays are allowed (streams that errored mid-flight), and no tool/data schema validation is performed at load time (that remains a userland concern viasafeValidateUIMessagesfrom the AI SDK).Message metadata on broadcast/resume path:
The server already captures
messageMetadatafromstart,finish, andmessage-metadatastream chunks and persists it onmessage.metadata. However, the client-side broadcast path (multi-tab sync) and stream resume path (reconnection) did not propagate metadata — theactiveStreamRefonly trackedparts. Now it also tracksmetadata, andflushActiveStreamToMessagesincludes it in the partial message flushed to React state. This means cross-tab clients and reconnecting clients see metadata (model info, token usage, timestamps) during streaming, not just after the finalCF_AGENT_CHAT_MESSAGESbroadcast.@cloudflare/codemode@0.0.8
Patch Changes
24e16e0Thanks @threepointone! - Widen peer dependency ranges across packages to prevent cascading major bumps during 0.x minor releases. Mark@cloudflare/ai-chatand@cloudflare/codemodeas optional peer dependencies ofagentsto fix unmet peer dependency warnings during installation.hono-agents@3.0.4
Patch Changes
24e16e0Thanks @threepointone! - Widen peer dependency ranges across packages to prevent cascading major bumps during 0.x minor releases. Mark@cloudflare/ai-chatand@cloudflare/codemodeas optional peer dependencies ofagentsto fix unmet peer dependency warnings during installation.