@@ -170,7 +170,9 @@ async def list_tools_from_server(workload: dict[str, Any]) -> dict[str, Any]:
170170 # ToolHive can proxy servers via SSE even if the original transport is stdio
171171 if proxy_mode == "sse" :
172172 # Use SSE client for SSE proxy
173- async with sse_client (url , httpx_client_factory = _create_tolerant_httpx_client ) as (read , write ):
173+ async with sse_client (
174+ url , httpx_client_factory = _create_tolerant_httpx_client
175+ ) as (read , write ):
174176 async with ClientSession (read , write ) as session :
175177 await session .initialize ()
176178 tools_response = await session .list_tools ()
@@ -309,7 +311,9 @@ async def get_tool_details_from_server(
309311
310312 # Connect and list tools to find the requested tool
311313 if proxy_mode == "sse" :
312- async with sse_client (url , httpx_client_factory = _create_tolerant_httpx_client ) as (read , write ):
314+ async with sse_client (
315+ url , httpx_client_factory = _create_tolerant_httpx_client
316+ ) as (read , write ):
313317 async with ClientSession (read , write ) as session :
314318 await session .initialize ()
315319 tools_response = await session .list_tools ()
@@ -416,7 +420,9 @@ async def call_tool(
416420
417421 # Connect and call the tool with timeout
418422 if proxy_mode == "sse" :
419- async with sse_client (url , httpx_client_factory = _create_tolerant_httpx_client ) as (read , write ):
423+ async with sse_client (
424+ url , httpx_client_factory = _create_tolerant_httpx_client
425+ ) as (read , write ):
420426 async with ClientSession (read , write ) as session :
421427 await session .initialize ()
422428 result = await asyncio .wait_for (
@@ -544,7 +550,9 @@ async def execute_calls(session):
544550 raise RuntimeError ("\n " .join (error_parts )) from e
545551
546552 if proxy_mode == "sse" :
547- async with sse_client (url , httpx_client_factory = _create_tolerant_httpx_client ) as (read , write ):
553+ async with sse_client (
554+ url , httpx_client_factory = _create_tolerant_httpx_client
555+ ) as (read , write ):
548556 async with ClientSession (read , write ) as session :
549557 await session .initialize ()
550558 await execute_calls (session )
0 commit comments