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.
This commit is contained in:
Classic298
2026-08-17 00:25:07 -06:00
committed by GitHub
parent 7d392bedc9
commit cd9db21c52
+2 -2
View File
@@ -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,