From ade2ea2e34a7077045116db144fdd332c6f96a69 Mon Sep 17 00:00:00 2001 From: Alexazhu Date: Sat, 18 Apr 2026 15:34:29 +0800 Subject: [PATCH] fix(browser_providers): preserve tracebacks in session-close exception logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The three managed browser providers (Browser Use, Firecrawl, Browserbase) all log the generic `except Exception as e:` fallback when a session-close request raises, but drop the traceback. When a cleanup path fails in production, the log shows the error string with no stack — which makes it hard to tell whether the SDK, the HTTP layer, or a third-party upstream misbehaved. Add `exc_info=True` to all three sites. --- tools/browser_providers/browser_use.py | 2 +- tools/browser_providers/browserbase.py | 2 +- tools/browser_providers/firecrawl.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/browser_providers/browser_use.py b/tools/browser_providers/browser_use.py index f8e9a8d9fa..3652fca6af 100644 --- a/tools/browser_providers/browser_use.py +++ b/tools/browser_providers/browser_use.py @@ -196,7 +196,7 @@ class BrowserUseProvider(CloudBrowserProvider): ) return False except Exception as e: - logger.error("Exception closing Browser Use session %s: %s", session_id, e) + logger.error("Exception closing Browser Use session %s: %s", session_id, e, exc_info=True) return False def emergency_cleanup(self, session_id: str) -> None: diff --git a/tools/browser_providers/browserbase.py b/tools/browser_providers/browserbase.py index 338ebf8989..a90a4dbc32 100644 --- a/tools/browser_providers/browserbase.py +++ b/tools/browser_providers/browserbase.py @@ -192,7 +192,7 @@ class BrowserbaseProvider(CloudBrowserProvider): ) return False except Exception as e: - logger.error("Exception closing Browserbase session %s: %s", session_id, e) + logger.error("Exception closing Browserbase session %s: %s", session_id, e, exc_info=True) return False def emergency_cleanup(self, session_id: str) -> None: diff --git a/tools/browser_providers/firecrawl.py b/tools/browser_providers/firecrawl.py index 3f8556fc12..13cf6ac6bb 100644 --- a/tools/browser_providers/firecrawl.py +++ b/tools/browser_providers/firecrawl.py @@ -91,7 +91,7 @@ class FirecrawlProvider(CloudBrowserProvider): ) return False except Exception as e: - logger.error("Exception closing Firecrawl session %s: %s", session_id, e) + logger.error("Exception closing Firecrawl session %s: %s", session_id, e, exc_info=True) return False def emergency_cleanup(self, session_id: str) -> None: