[PR #24306] [CLOSED] fix: merge filter tools with internal tools instead of replacing #131261

Closed
opened 2026-05-21 16:32:07 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24306
Author: @aayushbaluni
Created: 5/2/2026
Status: Closed

Base: mainHead: fix/24237-merge-filter-tools


📝 Commits (1)

  • ea9552c fix: merge filter tools with internal tools instead of replacing

📊 Changes

1 file changed (+23 additions, -6 deletions)

View changed files

📝 backend/open_webui/utils/middleware.py (+23 -6)

📄 Description

Description

Fix: merge filter tools with internal tools instead of replacing

Fixes #24237

When a filter function returns provider-native tools, process_chat_payload was overwriting the existing internal tools array instead of merging them. This caused internal tools to be silently dropped.

Changes:

  • Modified process_chat_payload to merge provider-native tools from filters with existing internal tools
  • If body["tools"] contains only provider-native entries, they are copied to provider_native_tool_addons and tools is popped, allowing resolution to proceed normally

Testing:

  • Verified that filter-returned tools are merged with existing internal tools
  • Verified that internal tools remain accessible when filters add provider-native tools

Contributor License Agreement

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT License and I have the authority to grant these rights.

Made with Cursor


🔄 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/24306 **Author:** [@aayushbaluni](https://github.com/aayushbaluni) **Created:** 5/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/24237-merge-filter-tools` --- ### 📝 Commits (1) - [`ea9552c`](https://github.com/open-webui/open-webui/commit/ea9552cc3d94ce16d4e9d80a3d000b16a45a1025) fix: merge filter tools with internal tools instead of replacing ### 📊 Changes **1 file changed** (+23 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/middleware.py` (+23 -6) </details> ### 📄 Description ## Description Fix: merge filter tools with internal tools instead of replacing Fixes #24237 When a filter function returns provider-native tools, `process_chat_payload` was overwriting the existing internal tools array instead of merging them. This caused internal tools to be silently dropped. ### Changes: - Modified `process_chat_payload` to merge provider-native tools from filters with existing internal tools - If `body["tools"]` contains only provider-native entries, they are copied to `provider_native_tool_addons` and `tools` is popped, allowing resolution to proceed normally ### Testing: - Verified that filter-returned tools are merged with existing internal tools - Verified that internal tools remain accessible when filters add provider-native tools --- ### Contributor License Agreement By submitting this pull request, I confirm that my contribution is made under the terms of the MIT License and I have the authority to grant these rights. - [x] I have read and agree to the [Contributor License Agreement](https://docs.openwebui.com/getting-started/cla) Made with [Cursor](https://cursor.com) --- <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-21 16:32:07 -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#131261