mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
fix(mcp): widen isinstance check to BaseException for CancelledError
asyncio.gather(return_exceptions=True) captures CancelledError as a BaseException value. The previous isinstance(result, Exception) check missed CancelledError, silently dropping it without logging. Since Python 3.9, CancelledError is a BaseException subclass (not Exception). This one-line change ensures all failure types from MCP server connections are properly logged. Fixes NousResearch/hermes-agent#34443
This commit is contained in:
parent
4fd8521e44
commit
9f5afc7636
1 changed files with 1 additions and 1 deletions
|
|
@ -3366,7 +3366,7 @@ def register_mcp_servers(servers: Dict[str, dict]) -> List[str]:
|
|||
return_exceptions=True,
|
||||
)
|
||||
for name, result in zip(server_names, results):
|
||||
if isinstance(result, Exception):
|
||||
if isinstance(result, BaseException):
|
||||
command = new_servers.get(name, {}).get("command")
|
||||
logger.warning(
|
||||
"Failed to connect to MCP server '%s'%s: %s",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue