ai@6.0.304: Improved Chat Stream Resume, Tool Output Handling, and Stream Updates
The ai@6.0.304 patch fixes chat stream resume logic, streamlines tool outputs within messages, prevents duplicate message parts, and improves streaming updates, providing greater reliability for developers using the library in interactive chat applications.
What changed?
The ai@6.0.304 release includes several fixes: - Resuming interrupted chat streams with `useChat` and `resume: true` no longer issues a second resume request on mount when the chat is already submitted or streaming. This addresses unwanted duplicate requests that could occur during remounts. - Tool outputs are now updated directly in the message that includes the relevant tool call, ensuring accurate and up-to-date tool output display. - Duplicate message parts are prevented when resuming replayed streams, eliminating repeated content in chat interfaces. - Streaming chat messages are now updated by stable ID, improving consistency when updating ongoing message streams. - Tool calls with no results are now rejected before sending further context to model providers, preventing invalid context propagation.
Why does it matter to an everyday developer?
These changes increase reliability for developers integrating streaming chat and tool-assisted messaging in web applications. The fixes address issues that could result in repeated network activity, duplicated chat content, outdated tool outputs, or inconsistent user interfaces. By handling chat stream resumes and message updates more robustly, developers can deliver smoother, more predictable chat experiences.
What can the developer do now?
Developers using the ai package for streaming chat or tool integrations should upgrade to version 6.0.304 to benefit from these fixes. Review any custom chat resume or tool output handling logic to ensure it aligns with the improved library behavior. Test chat session resumes, tool call workflows, and streaming messages to confirm the issues are resolved and no related application-specific workarounds are now obsolete.
