mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #21355] [CLOSED] fix: fix: prevent cascading reasoning item creation from inline think tags #26042
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21355
Author: @Classic298
Created: 2/13/2026
Status: ❌ Closed
Base:
dev← Head:reasoning-handling📝 Commits (2)
2c53d39fix: fix: prevent cascading reasoning item creation from inline think tags429f80cfix: reset content accumulator between streaming rounds to prevent think tag leakage📊 Changes
1 file changed (+48 additions, -11 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+48 -11)📄 Description
Fix reasoning trace rendering regression in v0.8.0 where inline reasoning tags (e.g. think/thinking) caused one collapsible block per token, freezing the browser.
Root cause: tag_output_handler did not strip the start tag from the content accumulator after detection, causing it to be re-detected on every subsequent token. Additionally, tokens arriving during an active reasoning block were routed to new message items instead of being appended to the reasoning item.
Changes:
Only affects providers sending reasoning as inline tags in the content delta (e.g. Google generativelanguage, Minimax, Ollama). Providers using the separate reasoning_content field (OpenAI, LiteLLM/OpenRouter) are unaffected.
Fixes #21348
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.