[PR #23932] [CLOSED] fix: strip client-provided tools for models without native tool calling #66300

Closed
opened 2026-05-06 12:34:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23932
Author: @pvyswiss
Created: 4/21/2026
Status: Closed

Base: mainHead: fix/strip-tools-non-native-models


📝 Commits (1)

  • d0b5f2d fix: strip client-provided tools for models without native tool calling

📊 Changes

1 file changed (+11 additions, -0 deletions)

View changed files

📝 backend/open_webui/utils/middleware.py (+11 -0)

📄 Description

Summary

Fixes #23924 (Ref: #23917 Bug 5)

  • Strip tools and tool_choice from form_data when the model doesn't have function_calling: "native"
  • API clients automatically send tools for features like title generation, causing Ollama to reject non-tool-capable models
  • The error handler returns null, crashing the SDK and killing concurrent streams

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/23932 **Author:** [@pvyswiss](https://github.com/pvyswiss) **Created:** 4/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/strip-tools-non-native-models` --- ### 📝 Commits (1) - [`d0b5f2d`](https://github.com/open-webui/open-webui/commit/d0b5f2daeef6444a3a250074995a270f0ad31c6b) fix: strip client-provided tools for models without native tool calling ### 📊 Changes **1 file changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/middleware.py` (+11 -0) </details> ### 📄 Description ## Summary Fixes #23924 (Ref: #23917 Bug 5) - Strip `tools` and `tool_choice` from `form_data` when the model doesn't have `function_calling: "native"` - API clients automatically send tools for features like title generation, causing Ollama to reject non-tool-capable models - The error handler returns `null`, crashing the SDK and killing concurrent streams --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 12:34:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#66300