From cd9db21c5276807a2975ddba17cef369ad1114b7 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 17 Aug 2026 08:25:07 +0200 Subject: [PATCH] refac: bind tool server cookies per connection (#28630) The tool callable now takes its connection's cookie jar as a parameter, matching how its headers are already passed and how the terminal tool factory in the same module builds its callables. --- backend/open_webui/utils/tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/utils/tools.py b/backend/open_webui/utils/tools.py index dd8eccc96f..8a8e980d06 100644 --- a/backend/open_webui/utils/tools.py +++ b/backend/open_webui/utils/tools.py @@ -443,7 +443,7 @@ async def get_tools(request: Request, tool_ids: list[str], user: UserModel, extr ) headers.setdefault('Content-Type', 'application/json') - async def make_tool_function(function_name, tool_server_data, headers): + async def make_tool_function(function_name, tool_server_data, headers, cookies): async def tool_function(**kwargs): return await execute_tool_server( url=tool_server_data['url'], @@ -456,7 +456,7 @@ async def get_tools(request: Request, tool_ids: list[str], user: UserModel, extr return tool_function - tool_function = await make_tool_function(function_name, tool_server_data, headers) + tool_function = await make_tool_function(function_name, tool_server_data, headers, cookies) callable = await get_async_tool_function_and_apply_extra_params( tool_function,