From f4c7caa70c002aed9287c2618cea0a4297f87970 Mon Sep 17 00:00:00 2001 From: XuefeiLi Date: Fri, 12 Jun 2026 19:54:02 +0800 Subject: [PATCH] fix(mcp): remove unreachable dead code after return in _make_redirect_handler --- tools/mcp_oauth.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tools/mcp_oauth.py b/tools/mcp_oauth.py index 4403ddd4ab6c..a5946544dec2 100644 --- a/tools/mcp_oauth.py +++ b/tools/mcp_oauth.py @@ -612,18 +612,6 @@ def _make_redirect_handler(port: int): return _redirect_handler - if _can_open_browser(): - try: - opened = webbrowser.open(authorization_url) - if opened: - print(" (Browser opened automatically.)\n", file=sys.stderr) - else: - print(" (Could not open browser — please open the URL manually.)\n", file=sys.stderr) - except Exception: - print(" (Could not open browser — please open the URL manually.)\n", file=sys.stderr) - else: - print(" (Headless environment detected — open the URL manually.)\n", file=sys.stderr) - async def _wait_for_callback() -> tuple[str, str | None]: """Wait for the OAuth callback to arrive on the local callback server.