From 3ccea416b4e69ef688acdd879c8cb7cd31d5ab84 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Fri, 16 Oct 2026 12:09:32 +0200 Subject: [PATCH] fix: built-in tools disappear when a model has a custom tools parameter (#32530) Adding a custom parameter named tools to a model, for example to turn on a provider's native web search, made Open WebUI drop all of its own tools for that model: notes, knowledge, tasks and any tools attached to the model stopped working, and attached files lost their context. Those tools now stay, and the model's custom tools are sent alongside them. API calls that pass their own tools, or an empty list to turn tools off, behave as before. Fixes #32528 --- backend/open_webui/utils/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 2fd2544af8..6d8cfe2b0a 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -2059,6 +2059,7 @@ async def process_chat_payload(request, form_data, user, metadata, model): # Keep the template before apply_params_to_form_data consumes the model parameters. model_system_prompt_template = (form_data.get('params') or {}).get('system') + payload_tools = form_data.get('tools', None) # snapshot before filters form_data = apply_params_to_form_data(form_data, model) log.debug('form_data: %s', form_data) @@ -2070,7 +2071,6 @@ async def process_chat_payload(request, form_data, user, metadata, model): chat_id = metadata.get('chat_id') user_message_id = metadata.get('user_message_id') pending_assistant_message = None - payload_tools = form_data.get('tools', None) # snapshot before filters chat = await Chats.get_chat_by_id(chat_id) if is_saved_chat_id(chat_id) else None is_note_chat = bool(chat and (chat.meta or {}).get('internal') is True and (chat.meta or {}).get('type') == 'note') use_builtin_tools = is_note_chat or (