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

12 hours ago

Patch Changes

  • #882 584cebe Thanks @alexanderjacobsen! - Fix multi-step client tool calling: pass stored client tool schemas to onChatMessage during tool continuations so the LLM can call additional client tools after auto-continuation. Also add a re-trigger mechanism to the client-side tool resolution effect to handle tool calls arriving during active resolution.

  • #891 0723b99 Thanks @ask-bonk! - Fix getCurrentAgent() returning undefined connection when used with @cloudflare/ai-chat and Vite SSR

    Re-export agentContext as __DO_NOT_USE_WILL_BREAK__agentContext from the main agents entry point and update @cloudflare/ai-chat to import it from agents instead of the agents/internal_context subpath export. This prevents Vite SSR pre-bundling from creating two separate AsyncLocalStorage instances, which caused getCurrentAgent().connection to be undefined inside onChatMessage and tool execute functions.

    The agents/internal_context subpath export has been removed from package.json and the deprecated agentContext alias has been removed from internal_context.ts. This was never a public API.

  • #886 4292f6b Thanks @whoiskatrin! - Forward custom body fields from client requests to onChatMessage options

    Custom data sent via prepareSendMessagesRequest or the AI SDK's body option in sendMessage is now available in the onChatMessage handler through options.body. This allows passing dynamic context (e.g., model selection, temperature, custom metadata) from the client to the server without workarounds.

Don't miss a new agents release

NewReleases is sending notifications on new releases.