mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-10 23:55:15 -05:00
[GH-ISSUE #20286] issue: Responses are duplicated for thinking models when streaming is enabled. #57807
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JadenJSJ on GitHub (Dec 31, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20286
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.43 (latest)
Ollama Version (if applicable)
No response
Operating System
24.04.1-Ubuntu
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Chat responses not duplicated for thinking models when streaming is enabled
Actual Behavior
Chat responses duplicated for thinking models when streaming is enabled
Steps to Reproduce
Logs & Screenshots
Browser console logs: checked it, not relevant
Screenshots
Response from https://arm.local/api/v1/chats/7746fab5-3acf-4f76-b21f-cc3ee7e5f010
Request Method: POST
Note that responses from the api seem to be normal
Additional Information
Docker Compose straight from the site
Is there something that I have set up wrongly?
If there are any other logs or additional information required please feel free to ask! :D
@owui-terminator[bot] commented on GitHub (Dec 31, 2025):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#20231 issue: Non-streaming responses with thinking enabled are not parsed correctly (thinking content merged into final answer)
by hamid370 • Dec 29, 2025 •
bug#19738 issue: Thinking models render responses inside thinking UI when using native tools
by qq3829596922 • Dec 04, 2025 •
bug#19925 issue: Model responses stop after web searches
by tm-coder-484 • Dec 13, 2025 •
bug#20019 issue:
by j63440490 • Dec 17, 2025 •
bug#19777 issue:
by Yaute7 • Dec 05, 2025 •
bugShow 5 more related issues
#20092 issue:
by VideoRyan • Dec 22, 2025 •
bug#20059 issue: Chat response is not working
by navilg • Dec 20, 2025 •
bug#19103 issue: no response from the model when ask in "channels"
by silenceroom • Nov 11, 2025 •
bug#19154 issue: model streaming parameter set to True, even though the setting is set to False
by DirkRemmers • Nov 13, 2025 •
bug#16788 issue: Rendering bug when the response from the model contains
<think>by alanxmay • Aug 21, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@rgaricano commented on GitHub (Dec 31, 2025):
The issue is in the streaming response handler in backend/open_webui/utils/middleware.py. When processing thinking models that include reasoning_content, the current implementation doesn't properly separate the reasoning blocks from the streaming content chunks.
The code processes each delta chunk and emits it via event_emitter().
For thinking models, both the reasoning content and regular content are being included in each emitted chunk, causing the duplication.
Fix, for reference:
(This fix prevents reasoning blocks from being duplicated by tracking whether they've already been emitted and only including them in the first chunk.)
Changes:
in
c2c389f722/backend/open_webui/utils/middleware.py (L2497-L2869)@tjbck commented on GitHub (Dec 31, 2025):
We never had any issues rendering reasoning content with other inference providers, this seem like its likely to be a gcli2api issue.
@Salamastik commented on GitHub (Dec 31, 2025):
+1 for this issue. I'm experiencing the same behavior.
@Classic298 commented on GitHub (Dec 31, 2025):
Yeah i have also never seen this before. This is likely an issue of your gcli application