# Cloudflare ships @cloudflare/ai-chat 0.12.4 with turn recovery and message-ordering changes

published: 2026-12-04T18:05:37.415Z
topic: frameworks
source: https://github.com/cloudflare/agents/releases/tag/%40cloudflare%2Fai-chat%400.12.4
url: https://aiagentnews.io/stories/cloudflare-ships-cloudflare-ai-chat-0-12-4-with-turn-recovery-and-message

Cloudflare's @cloudflare/ai-chat 0.12.4 changes how AIChatAgent and useAgentChat recover interrupted turns and order queued messages. The release requires agents 0.35.0 or later and migrates existing agent storage on first start.

The 0.12.4 release of @cloudflare/ai-chat changes how a turn cut off by a restart is handled. The turn is recovered under its original request id and ends once, and a message queued behind it is answered afterwards. Rate-limit, transient and overflow errors are now retried without a classifyChatError override, and chatRecovery.stableTimeoutMs is deprecated.

Message handling changes too. Messages sent during a running turn are stored when their own turn starts, and a reply cut off mid-stream is continued with a user message asking the model to carry on. Turns now write messages directly, so a persistMessages override no longer sees them. Each turn is traced as one invoke_agent span.

The package and @cloudflare/think need agents 0.35.0 or later, and the release notes say to upgrade agents, ai-chat and Think together. An agent from the previous release migrates its storage in place at its first start. Rolling back after that is not supported.

## Why it matters if you build agents

Agents built on ai-chat no longer need a classifyChatError override to retry rate-limit, transient and overflow errors, and they should stop relying on chatRecovery.stableTimeoutMs. Test the upgrade against a copy of production storage first, because the first start rewrites it and rollback is not supported. Upgrade agents, ai-chat and Think together to avoid version mismatches.
