From 21a5ccd58e81be67a6ac9a6f25199a2b2bfb8bfd Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 21 Apr 2026 19:44:30 +0800 Subject: [PATCH] fix: use bare raise instead of raise e to preserve traceback In mcp_client.py, `except Exception as e: raise e` loses the original traceback, making debugging harder. Use bare `raise` to preserve the full exception chain. Co-Authored-By: Claude Opus 4.7 --- trae_agent/utils/mcp_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trae_agent/utils/mcp_client.py b/trae_agent/utils/mcp_client.py index 3e89e5798..e6a4dd6b6 100644 --- a/trae_agent/utils/mcp_client.py +++ b/trae_agent/utils/mcp_client.py @@ -68,8 +68,8 @@ async def connect_and_discover( for tool in mcp_tools.tools: mcp_tool = MCPTool(self, tool, model_provider) mcp_tools_container.append(mcp_tool) - except Exception as e: - raise e + except Exception: + raise async def connect_to_server(self, mcp_server_name, transport): """Connect to an MCP server