Skip to content

Improve message streaming reliability

Choose a tag to compare

@damianvtran damianvtran released this 02 Aug 16:24
· 15 commits to main since this release
5de982f

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 requestAnimationFrame for scrolling and setTimeout delays 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 useStreamingMessage hook 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

Full Changelog: v0.12.4...v0.12.5