mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-02 06:39:02 -05:00
[PR #20729] [CLOSED] fix: respect built-in tool toggles in native function calling mode #41381
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20729
Author: @Classic298
Created: 1/16/2026
Status: ❌ Closed
Base:
dev← Head:fix-chat-tools📝 Commits (1)
d59aa8efix: respect built-in tool toggles in native function calling mode📊 Changes
1 file changed (+19 additions, -12 deletions)
View changed files
📝
backend/open_webui/utils/tools.py(+19 -12)📄 Description
fix: built-in tool toggles ignored in native function calling mode
Fixes: https://github.com/open-webui/open-webui/issues/20641
Problem
When using Native function calling mode with Built-in Tools capability enabled on a model, the chat interface toggles (web search ON/OFF, image generation ON/OFF, code interpreter ON/OFF) were completely ignored. All built-in tools were injected into the model's tool list regardless of the toggle state.
Impact
User Control Broken:
Admin Control Broken:
Inconsistent Behavior:
Reproduction Steps
Root Cause
In the get_builtin_tools function, the pattern for checking whether to inject a tool was inconsistent:
Memory tools (correct pattern):
Web search, image generation, code interpreter (broken pattern):
The features dict is populated from form_data after inlet() filters run, so this also meant inlet() filter modifications to toggle state had no effect on Native mode tool injection.
Solution
Added the missing feature toggle checks to align with the memory tools pattern:
Web search tools:
and features.get("web_search")Image generation/edit tools:
and features.get("image_generation")Code interpreter tool:
and features.get("code_interpreter")Now all built-in tools follow the same three-layer control model:
Behavior After Fix
Backward Compatibility
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.