Skip to content

Commit 10c5ca3

Browse files
committed
add log
1 parent 0bf03cd commit 10c5ca3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

eval_protocol/mcp/client/connection.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,20 @@ async def call_tool(self, session: MCPSession, tool_name: str, arguments: Dict)
410410
mcp_session = session._mcp_session
411411

412412
# 1. Execute the tool call via MCP protocol (DATA PLANE)
413-
tool_result = await mcp_session.call_tool(tool_name, arguments)
413+
retry_count = 3
414+
while retry_count > 0:
415+
try:
416+
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+
logging.info(f"Session {session.session_id} Row {session.dataset_row.id}: Tool {tool_name} call completed")
419+
break
420+
except httpx.TimeoutException:
421+
logger.warning(f"Session {session.session_id} Row {session.dataset_row.id}: Tool {tool_name} call timed out after 30s")
422+
retry_count -= 1
423+
if retry_count == 0:
424+
raise
425+
await asyncio.sleep(1)
426+
414427

415428
# Extract data plane results (observation only)
416429
if tool_result.content and len(tool_result.content) > 0:

0 commit comments

Comments
 (0)