Patch Changes
-
#882
584cebeThanks @alexanderjacobsen! - Fix multi-step client tool calling: pass stored client tool schemas toonChatMessageduring 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
0723b99Thanks @ask-bonk! - FixgetCurrentAgent()returningundefinedconnection when used with@cloudflare/ai-chatand Vite SSRRe-export
agentContextas__DO_NOT_USE_WILL_BREAK__agentContextfrom the mainagentsentry point and update@cloudflare/ai-chatto import it fromagentsinstead of theagents/internal_contextsubpath export. This prevents Vite SSR pre-bundling from creating two separateAsyncLocalStorageinstances, which causedgetCurrentAgent().connectionto beundefinedinsideonChatMessageand toolexecutefunctions.The
agents/internal_contextsubpath export has been removed frompackage.jsonand the deprecatedagentContextalias has been removed frominternal_context.ts. This was never a public API. -
#886
4292f6bThanks @whoiskatrin! - Forward custom body fields from client requests toonChatMessageoptionsCustom data sent via
prepareSendMessagesRequestor the AI SDK'sbodyoption insendMessageis now available in theonChatMessagehandler throughoptions.body. This allows passing dynamic context (e.g., model selection, temperature, custom metadata) from the client to the server without workarounds.