mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-23 01:51:58 -05:00
[GH-ISSUE #24635] issue: <details type="reasoning"> tag not rendered, displayed as raw text #91106
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 @siriusa51 on GitHub (May 13, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24635
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.9.5
Operating System
macOS
Browser (if applicable)
Chrome
Expected Behavior
When a model returns content with
<think>tags (reasoning/thinking content), Open WebUI should render them as collapsible/expandable<details type="reasoning">UI components in the chat view.Actual Behavior
The
<details type="reasoning" done="true" duration="0">tag is displayed as raw text in the chat message. The<summary>and content inside the<details>block are also shown as plain text instead of being rendered as a collapsible reasoning block.Example raw output visible to user:
Steps to Reproduce
<think>...</think>tags in its response (e.g., DeepSeek, Qwen, or any model configured to output reasoning content viareasoning_contentfield)<details type="reasoning">HTML tags are displayed as raw text instead of being rendered as collapsible componentsLogs & Screenshots
N/A — visible directly in the chat UI.
Additional Information
The root cause is the same as issue #24634 (which covers
type="tool_calls"). The problem is inserialize_output()inbackend/open_webui/utils/middleware.py:Text content and
<details>blocks are joined together with no blank line separator ("".join(parts)). In Markdown parsing, block-level elements need a blank line (\n\n) before them. Without it, marked's paragraph tokenizer absorbs the<details>tag, the customdetailsmarked extension is never triggered, and the HTML falls through to raw text rendering.I have posted a detailed root cause analysis and fix in https://github.com/open-webui/open-webui/issues/24634#issuecomment-4436505583
@owui-terminator[bot] commented on GitHub (May 13, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟢 #24634 issue:
This is the same rendering/parsing problem, just for
<details type="tool_calls">instead of<details type="reasoning">. The new issue even cites it as the sibling/root-cause bug inserialize_output(), so the fix path is shared.by sharyuke
🟣 #24537 issue: Reasoning tags are displayed as raw output for Gemini 3 Flash via LiteLLM
This closed issue reports raw reasoning tags being shown instead of the collapsible reasoning UI. It matches the same user-visible symptom and same reasoning-tag flow, making it the closest direct predecessor to the current bug.
by arnoulddw
💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.