[PR #21063] [CLOSED] fix: web search not working in native FC mode when builtin_tools is disabled #41538

Closed
opened 2026-04-25 13:44:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21063
Author: @ShikaiChen
Created: 1/31/2026
Status: Closed

Base: mainHead: fix/web-search-native-fc-decoupling


📝 Commits (1)

  • 02d54e2 fix: web search not working in native FC mode when builtin_tools is disabled

📊 Changes

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

View changed files

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

📄 Description

Summary

Relates to #20549

When builtin_tools capability is disabled on a model (e.g. to prevent builtin tools from being injected into API calls, as described in #20549), the entire get_builtin_tools() call is skipped in native function calling mode. This also disables web search, even when ENABLE_WEB_SEARCH=True and the model has web_search capability enabled.

This PR adds an elif fallback that injects only search_web and fetch_url tools when builtin_tools is off but web search should be available.

Changes

  • backend/open_webui/utils/middleware.py — 22 lines added (pure addition, zero existing lines modified)

Behavior matrix

builtin_tools web_search Result
ON ON All tools injected (unchanged)
ON OFF All tools injected (unchanged, WIP per #20595)
OFF ON Only web search tools injected (FIXED)
OFF OFF No tools injected (unchanged)
non-native FC any RAG path (unaffected)

Contributor License Agreement

contributor license agreement


🔄 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/21063 **Author:** [@ShikaiChen](https://github.com/ShikaiChen) **Created:** 1/31/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/web-search-native-fc-decoupling` --- ### 📝 Commits (1) - [`02d54e2`](https://github.com/open-webui/open-webui/commit/02d54e26997ebb48ca910b106de34499cc443e1b) fix: web search not working in native FC mode when builtin_tools is disabled ### 📊 Changes **1 file changed** (+22 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/middleware.py` (+22 -0) </details> ### 📄 Description ## Summary Relates to #20549 When `builtin_tools` capability is disabled on a model (e.g. to prevent builtin tools from being injected into API calls, as described in #20549), the entire `get_builtin_tools()` call is skipped in native function calling mode. This also disables web search, even when `ENABLE_WEB_SEARCH=True` and the model has `web_search` capability enabled. This PR adds an `elif` fallback that injects only `search_web` and `fetch_url` tools when `builtin_tools` is off but web search should be available. ## Changes - `backend/open_webui/utils/middleware.py` — 22 lines added (pure addition, zero existing lines modified) ## Behavior matrix | builtin_tools | web_search | Result | |:---:|:---:|---| | ON | ON | All tools injected (unchanged) | | ON | OFF | All tools injected (unchanged, WIP per #20595) | | **OFF** | **ON** | **Only web search tools injected (FIXED)** | | OFF | OFF | No tools injected (unchanged) | | non-native FC | any | RAG path (unaffected) | ## Contributor License Agreement contributor license agreement --- <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-04-25 13:44:59 -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#41538