mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-15 21:19:39 -05:00
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/24798
Author: @Classic298
Created: 5/15/2026
Status: 🔄 Open
Base:
dev← Head:fix/convert-output-orphan-tool-calls📝 Commits (1)
8658e0afix: drop unpaired tool_use/tool_result when reconstructing from stored output (#24758)📊 Changes
1 file changed (+60 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/misc.py(+60 -1)📄 Description
convert_output_to_messages() emitted an assistant tool_calls entry with no following tool message whenever a function_call_output was missing from the stored output (e.g. lost when a knowledge base is updated mid-chat, or a tool call interrupted before its result was written). Strict providers (Anthropic, AWS Bedrock Converse) reject the resulting history with a 400: "tool_use ids were found without tool_result blocks".
Add a reconciliation pass after flush_pending() that strips any assistant tool_call whose id has no matching tool message, drops an assistant message left empty by that stripping, and symmetrically drops a tool message whose tool_call_id has no surviving tool_call. Well-formed output is unaffected: every id pairs, so nothing is stripped (verified no-op for single and multi-call batches).
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.