It's basic: it opens a Ydoc for any transmitted message, calculates the Ydoc updates, and transmits only those updates, with basic support for emitters and Redis. I've applied it to the reasoning block, but it can easily be added to other serializations (if needed).
Since it's a draft, I've implemented a new, dedicated Ydoc manager class and left the existing Ydoc manager unchanged.
I've done some testing, and it seems to work correctly, as expected, but in my current setup, it's difficult to work on it properly (slow connection on mobile device, home remote dev server, no pods, etc.). Please review and test it.
BR
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
Note
Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/24124
**Author:** [@rgaricano](https://github.com/rgaricano)
**Created:** 4/25/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `dev-Yjs_streaming_chat`
---
### 📝 Commits (1)
- [`4e847ad`](https://github.com/open-webui/open-webui/commit/4e847ad2335848e65e53cf06eab52eee96bdf45d) FIX:23733 - Ydoc_streaming_chat
### 📊 Changes
**5 files changed** (+393 additions, -9 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/socket/main.py` (+33 -2)
📝 `backend/open_webui/socket/utils.py` (+111 -2)
📝 `backend/open_webui/utils/middleware.py` (+33 -5)
📝 `src/lib/components/chat/Messages/ResponseMessage.svelte` (+20 -0)
➕ `src/lib/utils/ChatMessageYjs.ts` (+196 -0)
</details>
### 📄 Description
PR to FIX Issue #23733 (https://github.com/open-webui/open-webui/issues/23733) as I drew it in https://github.com/open-webui/open-webui/issues/23733#issuecomment-4265946838
---
This is a draft for using Ydoc to transmit message updates and address the main issue described in https://github.com/open-webui/open-webui/issues/23733.
It's basic: it opens a Ydoc for any transmitted message, calculates the Ydoc updates, and transmits only those updates, with basic support for emitters and Redis. I've applied it to the reasoning block, but it can easily be added to other serializations (if needed).
Since it's a draft, I've implemented a new, dedicated Ydoc manager class and left the existing Ydoc manager unchanged.
I've done some testing, and it seems to work correctly, as expected, but in my current setup, it's difficult to work on it properly (slow connection on mobile device, home remote dev server, no pods, etc.). Please review and test it.
BR
___
### Contributor License Agreement
- [X] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
> [!NOTE]
> Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24124
Author: @rgaricano
Created: 4/25/2026
Status: ❌ Closed
Base:
main← Head:dev-Yjs_streaming_chat📝 Commits (1)
4e847adFIX:23733 - Ydoc_streaming_chat📊 Changes
5 files changed (+393 additions, -9 deletions)
View changed files
📝
backend/open_webui/socket/main.py(+33 -2)📝
backend/open_webui/socket/utils.py(+111 -2)📝
backend/open_webui/utils/middleware.py(+33 -5)📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+20 -0)➕
src/lib/utils/ChatMessageYjs.ts(+196 -0)📄 Description
PR to FIX Issue #23733 (https://github.com/open-webui/open-webui/issues/23733) as I drew it in https://github.com/open-webui/open-webui/issues/23733#issuecomment-4265946838
This is a draft for using Ydoc to transmit message updates and address the main issue described in https://github.com/open-webui/open-webui/issues/23733.
It's basic: it opens a Ydoc for any transmitted message, calculates the Ydoc updates, and transmits only those updates, with basic support for emitters and Redis. I've applied it to the reasoning block, but it can easily be added to other serializations (if needed).
Since it's a draft, I've implemented a new, dedicated Ydoc manager class and left the existing Ydoc manager unchanged.
I've done some testing, and it seems to work correctly, as expected, but in my current setup, it's difficult to work on it properly (slow connection on mobile device, home remote dev server, no pods, etc.). Please review and test it.
BR
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.