Skip to content

fix: streaming response due to high number of redis pub/sub channels, better handling of connection issues#6114

Merged
0xi4o merged 10 commits intomainfrom
fix/streaming-2
Apr 2, 2026
Merged

fix: streaming response due to high number of redis pub/sub channels, better handling of connection issues#6114
0xi4o merged 10 commits intomainfrom
fix/streaming-2

Conversation

@0xi4o
Copy link
Copy Markdown
Contributor

@0xi4o 0xi4o commented Apr 1, 2026

follow up to: #6008

  • also fixes how "thinking" event was handled in redis pub/sub and sse

@0xi4o 0xi4o requested review from HenryHengZJ and yau-wd April 1, 2026 16:14
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the SSE streaming and Redis pub/sub infrastructure by introducing a heartbeat mechanism, periodic subscription cleanup, and improved error handling. The SSEStreamer now utilizes a Map for client management and a safeWrite method to handle disconnected clients gracefully. Review feedback identifies a redundant manual resubscription logic in the Redis subscriber that could lead to duplicate events, inconsistencies in the SSE message formatting, and a recommendation for a more robust nullish check on chatId.

Comment thread packages/server/src/queue/RedisEventSubscriber.ts Outdated
Comment thread packages/server/src/utils/SSEStreamer.ts
Comment thread packages/server/src/queue/RedisEventSubscriber.ts Outdated
@0xi4o 0xi4o merged commit 1707688 into main Apr 2, 2026
7 checks passed
@0xi4o 0xi4o deleted the fix/streaming-2 branch April 2, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants