Fix IDE warnings (#12085)

### What problem does this PR solve?

As title

### Type of change

- [x] Refactoring

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2025-12-22 16:47:21 +08:00
committed by GitHub
parent b42b5fcf65
commit 993bf7c2c8
7 changed files with 22 additions and 14 deletions

View File

@ -326,7 +326,6 @@ async def list_tools() -> Response:
try:
tools = await asyncio.to_thread(tool_call_session.get_tools, timeout)
except Exception as e:
tools = []
return get_data_error_result(message=f"MCP list tools error: {e}")
results[server_key] = []
@ -428,7 +427,6 @@ async def test_mcp() -> Response:
try:
tools = await asyncio.to_thread(tool_call_session.get_tools, timeout)
except Exception as e:
tools = []
return get_data_error_result(message=f"Test MCP error: {e}")
finally:
# PERF: blocking call to close sessions — consider moving to background thread or task queue