ClaudeCloudflare Developer PlatformMay 13, 2026, 12:00 AM

Agents, Workers - Agents SDK v0.12.4: chat recovery, routing retries, durable Think submissions, and Voice connection control

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

claudeen

Agents, Workers - Agents SDK v0.12.4: chat recovery, routing retries, durable Think submissions, and Voice connection control Summary

Key Points

  • Point 1: Changelog New updates and improvements at Cloudflare.
  • Point 2: Subscribe to RSS View RSS feeds ← Back to all posts Agents SDK v0.12.4: chat recovery, routing retries, durable Think submissions, and Voice connection control May 13, 2026 Agents
  • Point 3: Chat recovery improvements @cloudflare/ai-chat now keeps server turns running when a browser or client stream is interrupted.

Summary

This is an English summary of "Agents, Workers - Agents SDK v0.12.4: chat recovery, routing retries, durable Think submissions, and Voice connection control" published on 2026-05-13.

Key Points

  • Point 1: Changelog New updates and improvements at Cloudflare.
  • Point 2: Subscribe to RSS View RSS feeds ← Back to all posts Agents SDK v0.12.4: chat recovery, routing retries, durable Think submissions, and Voice connection control May 13, 2026 Agents
  • Point 3: Chat recovery improvements @cloudflare/ai-chat now keeps server turns running when a browser or client stream is interrupted.

Full Translation

Translations

A translation section that keeps the flow of the original article.

claudeja

Agents, Workers - Agents SDK v0.12.4: chat recovery, routing retries, durable Think submissions, and Voice connection control(原文タイトル)

概要

公開日: 2026-05-13 翻訳生成に失敗したため、原文をそのまま保存しています。

原文

Changelog New updates and improvements at Cloudflare. Subscribe to RSS View RSS feeds ← Back to all posts Agents SDK v0.12.4: chat recovery, routing retries, durable Think submissions, and Voice connection control May 13, 2026 Agents Workers The latest release of the Agents SDK ↗ brings more reliable chat recovery, fixes Agent state synchronization during reconnects, adds durable submissions for Think, exposes routing retry configuration, and adds connection control for Voice agents. Chat recovery improvements @cloudflare/ai-chat now keeps server turns running when a browser or client stream is interrupted. This is useful for long-running AI responses where users refresh the page, close a tab, or temporarily lose connection. Calling stop() still cancels the server turn. Set cancelOnClientAbort: true if browser or client aborts should also cancel the server turn: JavaScript TypeScript JavaScript const chat = useAgentChat ( { agent : "assistant" , name : "user-123" , cancelOnClientAbort : true , } ) ; TypeScript const chat = useAgentChat ( { agent : "assistant" , name : "user-123" , cancelOnClientAbort : true , } ) ; Notable bug fixes: Chat stream resume negotiation no longer throws when replay races with a closed WebSocket connection. Recovered chat continuations no longer leave useAgentChat stuck in a streaming state when the original socket disconnects before a terminal response. Approval auto-continuation preserves reasoning parts and persists continuation reasoning in the final message. isServerStreaming now resets correctly when a resumed stream moves from the fallback observer path to a transport-owned stream. Agent state and routing fixes agents@0.12.4 prevents duplicate initial state frames during WebSocket connection setup. This avoids stale initial state messages overwriting state updates already sent by the client. Agent recovery is also more reliable when tool calls span a Durable Object restart. Recovery now defers user finish hooks until after agent startup and isolates hook failures, so one failed hook does not block other recovered runs from finalizing. getAgentByName() now supports routingRetry for transient Durable Object routing failures: JavaScript TypeScript JavaScript import { getAgentByName } from "agents" ; const agent = await getAgentByName ( env . AssistantAgent , "user-123" , { routingRetry : { maxAttempts : 3 , }, } ) ; TypeScript import { getAgentByName } from "agents" ; const agent = await getAgentByName ( env . AssistantAgent , "user-123" , { routingRetry : { maxAttempts : 3 , }, } ) ; Durable Think submissions @cloudflare/think now supports durable programmatic submissions. submitMessages() provides durable acceptance, idempotent retries, status inspection, cancellation, and cleanup for server-driven turns that should continue after the caller returns. Think.chat() RPC turns now run inside chat recovery fibers and persist their stream chunks. Interrupted sub-agent turns can recover partial output instead of starting over. ChatOptions.tools has been removed from the TypeScript API. Define durable tools on the child agent or use agent tools for orchestration. Runtime options.tools values passed by legacy callers are ignored with a warning. Think message pruning behavior change @cloudflare/think no longer applies pruneMessages({ toolCalls: "before-last-2-messages" }) to model context by default. The previous default could strip client-side tool results from longer multi-turn flows. truncateOlderMessages still runs as before, so context cost remains bounded. Subclasses that relied on the old aggressive pruning can opt back in from beforeTurn : JavaScript TypeScript JavaScript import { Think } from "@cloudflare/think" ; import { pruneMessages } from "ai" ; export class MyAgent extends Think { beforeTurn ( ctx ) { return { messages : pruneMessages ( { messages : ctx . messages , toolCalls : "before-last-2-messages" , } ) , }; } } TypeScript import { Think } from "@cloudflare/think" ; import { pruneMess