# @cloudflare/ai-chat@0.12.1

Category: agent-infrastructure
Published: 2026-10-02T12:30:25Z
Source: [Cloudflare Agents SDK releases](https://github.com/cloudflare/agents/releases/tag/%40cloudflare%2Fai-chat%400.12.1)
Agent usefulness: 77/100
Confidence: 0.96
Content mode: release-watch
Verified: 2026-10-07T08:17:47.349Z
Tags: cloudflare, agents-sdk, edge-runtime

## Human Summary
Cloudflare's @cloudflare/ai-chat patch release (0.12.1) improves streaming reliability, error recovery, and tool call handling across agent chat sessions.

## Agent Summary
Patch release @cloudflare/ai-chat@0.12.1 introduces eventDelivery: 'terminal' in runAgentTool, adds useAgentChat.onTurnEnd, implements session.mirror(), deprecates resolveToolMergeId in favor of reconcileMessages, and requires agents@ =0.25.0.

## Body
The @cloudflare/ai-chat 0.12.1 release brings multiple bug fixes and enhancements across agent tools, chat agents, sessions, and client tool continuations. Key updates include: requiring agents@ =0.25.0; adding eventDelivery: 'terminal' in runAgentTool to selectively forward lifecycle, progress, and milestone events; introducing useAgentChat onTurnEnd along with outcomes and user message IDs in terminal chat frames; adding session.mirror() to synchronize in-memory transcripts with session change feeds; and deprecating resolveToolMergeId in favor of reconcileMessages to handle reused toolCallIds. Several fixes address edge cases in streaming and reconnects, including handling duplicate/dropped agent-tool chunks, preventing duplicate text on tool continuation reconnects, retaining tool inputs when approval requests arrive early, settling unrun approved tool calls, recovering from transient response-reader errors, and properly reporting continuation errors instead of hanging.

## Recommended actions
- Upgrade the project dependency to agents@ =0.25.0 when updating to @cloudflare/ai-chat@0.12.1.
- Migrate existing usages of resolveToolMergeId to reconcileMessages.
- Optionally leverage useAgentChat onTurnEnd and terminal chat frame metadata for more resilient client-side turn handling across reconnects.
- Adopt session.mirror() if maintaining an in-memory transcript synchronized with a session's change feed is required.

## Sponsors
No sponsor placement attached.

## Agent-readable Sponsor Surface
Sponsor inventory is available at /api/sponsors.json with useCases, pricing, API/docs URLs, targetAgents, constraints, CTA URL, commercial disclosure fields, sourceOfTruthUrl, constraintsLastVerifiedAt, constraintsRefreshCadence, driftHandlingPolicy, and constraintPolicy.