Improve message streaming reliability
What's Changed
This release addresses several bugs related to real-time message streaming to make the user experience more robust and reliable.
- Robust Streaming State Management: The logic for determining when a message is actively streaming has been significantly improved. By using a centralized store (
useStreamingMessagesStore) and more sophisticated checks, the application now more accurately tracks the completion state of a message, fixing bugs where the streaming indicator would disappear prematurely or persist incorrectly. - Elimination of Race Conditions: The code now uses
requestAnimationFramefor scrolling andsetTimeoutdelays for completion callbacks and data refetching. This ensures that UI updates and state changes are fully processed before subsequent actions are triggered, preventing race conditions. - Improved UI Responsiveness: The
useStreamingMessagehook has been optimized to update the UI more quickly and reduce excessive re-renders during streaming. - Enhanced Reliability: The WebSocket connection management has been improved with better cleanup logic, preventing potential resource leaks.
Impact
- No Breaking Changes: These changes are non-breaking and focus on improving existing functionality.
- Improved User Experience: The fixes provide a much more stable and predictable UI during agent interactions.
PRs
- fix: Improve message streaming reliability by @damianvtran in #75
Full Changelog: v0.12.4...v0.12.5