github cloudflare/agents @cloudflare/ai-chat@0.12.3

one hour ago

This release fixes chat races across tabs and during recovery, so stop, clear, regenerate and resume do what the user asked even while another tab or a recovery is streaming. A chat request cancelled while it waits in the queue no longer runs, and when onError returns instead of throwing, AIChatAgent passes the original error on. No changes are needed to upgrade.

Patch Changes

  • #2832 c31b57e Thanks @ben-reitz! - When onError returns instead of throwing, Agent and AIChatAgent now pass the original error on, instead of undefined (or an unawaited promise when onError is async).

  • #2818 a2f1216 Thanks @ben-reitz! - Cancelling a chat request while it waits in the queue now stops it from running, instead of the cancel being dropped. See #2701.

  • #2861 f0f4ed9 Thanks @mattzcarey! - Fix chat recovery and resume races: stop now ends a running recovery, recovery yields to a newer question, and a stale resume ACK keeps the tab waiting for the active stream's replay.

  • #2860 7e2e11e Thanks @mattzcarey! - Fix chat turn races across tabs: clear stops pending replies, regenerate replaces a reply still streaming, a throwing onChatMessage sends an error frame, and repeated tool results no longer re-run the model.

Don't miss a new agents release

NewReleases is sending notifications on new releases.