mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-14 19:16:08 -05:00
[PR #18840] [CLOSED] fix: <details> tags for reasoning not identified if tag is present in user message #11785
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/18840
Author: @acomarcho
Created: 11/1/2025
Status: ❌ Closed
Base:
dev← Head:fix/details-tag-for-reasoning-not-identified📝 Commits (1)
867d0cffix:📊 Changes
2 files changed (+15 additions, -3 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+4 -2)📝
src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte(+11 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch. Not targeting thedevbranch may lead to immediate closure of the PR.Changelog Entry
Description
Fixes this bug presented in https://github.com/open-webui/open-webui/issues/18294 .
See "Additional information" for technical details.
Added
None
Changed
None
Deprecated
None
Removed
None
Fixed
Fixes issue https://github.com/open-webui/open-webui/issues/18294
Security
None
Breaking Changes
None
Additional Information
Before, as the contents were not escaped, the block had some troubles deciding which one is the actual
<details>block. The main reason was because the serialization of reasoning blocks inmiddleware.pyis not escaped.This is different from tool_calls that already do it:
or
code_interpreterthat does it too:By following the same logic to perform HTML escape in the reasoning part, i.e. adding:
and properly decoding it at the frontend, this problem is solved.
Screenshots or Videos
https://github.com/user-attachments/assets/1990b9a8-d7be-414c-9b0d-5a2babaa30ca
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.