mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #24014] [CLOSED] fix: native tool-call continuation for Kimi thinking models #43107
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/24014
Author: @safzanpirani
Created: 4/22/2026
Status: ❌ Closed
Base:
dev← Head:fix-kimi-tool-reasoning-continuation📝 Commits (1)
2383e94Fix Kimi tool-call continuation reasoning📊 Changes
3 files changed (+283 additions, -3 deletions)
View changed files
➕
backend/open_webui/test/util/test_misc.py(+158 -0)📝
backend/open_webui/utils/middleware.py(+12 -3)📝
backend/open_webui/utils/misc.py(+113 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. PRs targetingmainwill be immediately closed.dev, and only contains the continuation fix and regression coverage.fix:prefix.Changelog Entry
Description
reasoning_contentwhen Open WebUI rebuilds assistant tool-call messages for Kimi/Moonshot continuation turns so native tool calling can continue to a final answer.Added
Changed
convert_output_to_messages()globally.Deprecated
Removed
Fixed
reasoning_content.Security
Breaking Changes
Additional Information
reasoning_contentfor model IDs that look like Kimi/Moonshot.streaming_chat_response_handler.Screenshots or Videos
Testing Performed
kimi-k2.6in native tool mode:list my notessearch_notesexecuted and the assistant returned a normal final answer instead of stopping after the tool result.web search for "Rakhi Kaag"conversation that previously stopped aftersearch_web.search_webexecuted and the assistant returned a normal final answer after the tool result.reasoning_contenton the assistant tool-call message, the continuation request failed with the error quoted above.reasoning_contentpreserved, the provider returned a normal final answer.python3 -m py_compile backend/open_webui/utils/misc.py backend/open_webui/utils/middleware.py backend/open_webui/test/util/test_misc.pyadd_reasoning_content_to_tool_messages()with multi-step tool-call output sequences to confirm reasoning is reattached to the matching assistant tool-call turn.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.