Skip to content

Commit c0d6185

Browse files
committed
fix timeout
1 parent 10c5ca3 commit c0d6185

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

eval_protocol/mcp/client/connection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import asyncio
9+
from datetime import timedelta
910
import hashlib
1011
import json
1112
import logging
@@ -69,7 +70,7 @@ async def initialize_session(self, session: MCPSession) -> None:
6970
)
7071

7172
mcp_session = await exit_stack.enter_async_context(
72-
ClientSession(read_stream, write_stream, client_info=client_info, read_timeout_seconds=30.0)
73+
ClientSession(read_stream, write_stream, client_info=client_info, read_timeout_seconds=timedelta(seconds=30))
7374
)
7475

7576
await mcp_session.initialize()
@@ -414,7 +415,7 @@ async def call_tool(self, session: MCPSession, tool_name: str, arguments: Dict)
414415
while retry_count > 0:
415416
try:
416417
logging.info(f"Session {session.session_id} Row {session.dataset_row.id}: Tool {tool_name} call started")
417-
tool_result = await mcp_session.call_tool(tool_name, arguments, read_timeout_seconds=30.0)
418+
tool_result = await mcp_session.call_tool(tool_name, arguments, read_timeout_seconds=timedelta(seconds=30))
418419
logging.info(f"Session {session.session_id} Row {session.dataset_row.id}: Tool {tool_name} call completed")
419420
break
420421
except httpx.TimeoutException:

0 commit comments

Comments
 (0)