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

one hour ago

Patch Changes

  • #3988 17862ac Thanks @mattzcarey! - AIChatAgent and useAgentChat. See Upgrading from ai-chat 0.12.

    • A turn cut off by a restart is recovered under its request id and ends once; a message queued behind it is answered afterwards.
    • Rate-limit, transient and overflow errors are retried without classifyChatError; chatRecovery.stableTimeoutMs is deprecated.
    • While a reply cut off mid-stream is continued, this.messages ends in a user message asking the model to carry on.
    • A message sent while a turn runs is stored when its own turn starts, so the transcript reads U1, A1, U2, A2.
    • A new message sent while a reply waits on a client tool or an approval is answered, with the waiting call failed first.
    • continueLastTurn() is skipped while the reply waits on a client tool or an approval; recovery no longer calls an overridden one.
    • Turns store their messages directly: a persistMessages override no longer sees a turn's writes.
    • getCurrentAgent().connection in a turn is the asking tab while it is connected, and its new connection after a reconnect.
    • Each turn is traced as one invoke_agent span; three setup spans are gone.
    • useAgentChat: a Clear while a reply streams no longer leaves the partial reply, and a recovering reply is not reported as error.
  • #3988 17862ac Thanks @mattzcarey! - Upgrade agents, @cloudflare/ai-chat and @cloudflare/think together. See Upgrading from ai-chat 0.12 and Upgrading Think from 0.24.

    • @cloudflare/ai-chat and @cloudflare/think need agents 0.35.0 or later; agents/chat is internal and exports less.
    • An agent from the previous release migrates its storage in place at its first start; rolling back afterwards is not supported.

Don't miss a new agents release

NewReleases is sending notifications on new releases.