diff --git a/backend/packages/harness/deerflow/mcp/cache.py b/backend/packages/harness/deerflow/mcp/cache.py index 38750e135..c1121f59d 100644 --- a/backend/packages/harness/deerflow/mcp/cache.py +++ b/backend/packages/harness/deerflow/mcp/cache.py @@ -118,9 +118,13 @@ def get_cached_mcp_tools() -> list[BaseTool]: loop.run_until_complete(initialize_mcp_tools()) except RuntimeError: # No event loop exists, create one - asyncio.run(initialize_mcp_tools()) - except Exception as e: - logger.error(f"Failed to lazy-initialize MCP tools: {e}") + try: + asyncio.run(initialize_mcp_tools()) + except Exception: + logger.exception("Failed to lazy-initialize MCP tools") + return [] + except Exception: + logger.exception("Failed to lazy-initialize MCP tools") return [] return _mcp_tools_cache or []