mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 08:21:12 -05:00
[GH-ISSUE #24634] issue: <details type="tool_calls"> tag not rendered, displayed as raw text #107360
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 @sharyuke on GitHub (May 13, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24634
Bug Report
Check Existing Issues
Installation Method
Docker
Open WebUI Version
latest (please specify your version)
Operating System
Linux
Expected Behavior
When MiniMax series models (e.g., MiniMax-M2.7-highspeed, MiniMax-M2.1) output tool calls using
<details type="tool_calls">HTML tags, OpenWebUI should render them as collapsible/expandable UI components, not display raw HTML tags as plain text.Actual Behavior
The
<details type="tool_calls" done="true" id="call_function_xxx">tag is displayed as raw text at the top of the response. The<summary>content and the closing</details>tag are similarly shown as plain text instead of being rendered as an interactive collapsible section. The tool call content (JSON payload) is also exposed as raw text.Example raw output visible to user:
The
detailstag appears as a large heading at the top of the response, completely unstyled and unparsed.Steps to Reproduce
<details type="tool_calls">tags are rendered as raw text instead of collapsible UI componentsLogs & Screenshots
Screenshot attached showing raw
<details type="tool_calls">tag output from MiniMax-M2.7-highspeed model.Additional Information
</details>tags for reasoning/thinking content (where</details>appears at the start of a new text block due to improper tag closing before tool calls)details type="tool_calls"tags which are used by MiniMax models to encapsulate function calling outputdetailstag withtype="tool_calls"is not recognized as a valid HTML tag that should be rendered, and instead gets passed through as raw text@sharyuke commented on GitHub (May 13, 2026):
Screenshot
@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:
🟣 #24291 Minimax tool_call not working
This is the closest Minimax-specific tool-calling issue. It confirms Open WebUI has compatibility problems with Minimax tool_call output, which is likely the same integration area causing the
<details type="tool_calls">markup to be mishandled.by sharyuke
🟣 #21860 issue: Inconsistent HTML Rendering: Escaped in Chat, Rendered in Notification
This issue is about inconsistent HTML rendering versus escaping in chat, which is directly relevant to a report where a
<details>block is being shown as raw text instead of being rendered or consistently processed.by Mywk ·
bug🟣 #20600 issue: Tool call results not decoded from HTML entities before sending to LLM
This bug concerns the
processDetails()path and HTML-escaped tool-call content, which is part of the same tool-call rendering/parsing pipeline and may share the underlying issue of how tool-call markup is handled.by Koumi460 ·
bug,confirmed issue💡 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.
@siriusa51 commented on GitHub (May 13, 2026):
Same Root Cause Also Affects
type="reasoning"BlocksI have investigated this issue and identified the root cause. It also affects
<details type="reasoning">blocks (generated from<think>tags) in the same way.Root Cause
The problem is in
serialize_output()inbackend/open_webui/utils/middleware.py.The function collects all output items (text messages, reasoning blocks, tool calls) into a
partslist, then joins them with:This concatenates text content and
<details>blocks directly with no blank line separator:In Markdown, block-level elements (including
<details>) must be preceded by a blank line (\n\n) to be recognized as a new block. Without it, marked's paragraph tokenizer absorbs the<details>tag into the preceding paragraph, preventing the customdetailsmarked extension from ever being triggered.When the custom extension is not triggered, marked falls back to its built-in HTML tokenizer, which produces an
htmltoken. InHTMLToken.svelte, this token is rendered via{token.text}(textContent interpolation), displaying the raw HTML string.Fix
Change the join separator from
""to"\n\n"inserialize_output():This ensures a blank line exists between every block-level element, allowing marked's parser to correctly separate paragraphs from
<details>blocks and route them to the customdetailsmarked extension.Affected Types
All
<details>block types are affected:type="reasoning"— from<think>tag processingtype="tool_calls"— from function/tool callingtype="code_interpreter"— from code executionRelated Code
serialize_output: https://github.com/open-webui/open-webui/blob/main/backend/open_webui/utils/middleware.py#L457src/lib/utils/marked/extension.tssrc/lib/components/chat/Messages/Markdown/HTMLToken.svelte@sharyuke commented on GitHub (May 13, 2026):
Thanks for the detailed root cause analysis! I'll try the fix now.
@Classic298 commented on GitHub (May 13, 2026):
almost 100% certain this is a model or provider issue
@Classic298 commented on GitHub (May 17, 2026):
Cannot reproduce via OpenRouter.
Need steps to reproduce here that actually cause this. Moving to discussions for now