mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[PR #21050] [CLOSED] fix: Handle unclosed reasoning tags across tool call iterations #96941
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/21050
Author: @Classic298
Created: 1/29/2026
Status: ❌ Closed
Base:
dev← Head:fix-tags📝 Commits (2)
0562f1afix: Handle unclosed reasoning tags across tool call iterations84a01b8Merge branch 'dev' into fix-tags📊 Changes
1 file changed (+34 additions, -12 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+34 -12)📄 Description
Summary
Fixes text duplication and raw tag rendering when models use inline reasoning tags (like ) but don't close them before tool calls.
Problem
Some models (e.g., MiniMax M2.1, Kimi K2) output reasoning content using inline tags but don't always close them with before making tool calls. On subsequent iterations:
Solution
Testing
Tested with MiniMax M2.1 using multiple tool call iterations with web search - reasoning blocks now render correctly and text no longer duplicates.
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.