From 0bab0125d72f167c4ae853f166800504bfe36896 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Tue, 31 Mar 2026 15:30:11 +0200 Subject: [PATCH] _start_dashboard_viewer: Do nothing if no display detected, improve logging --- src/serena/agent.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/serena/agent.py b/src/serena/agent.py index 76d42224..91431192 100644 --- a/src/serena/agent.py +++ b/src/serena/agent.py @@ -541,12 +541,17 @@ class SerenaAgent: :param minimized: whether the dashboard viewer should be started minimized (if supported on the current platform). If the viewer is not supported on the current platform, then this controls whether to open the browser window. """ + if not system_has_usable_display(): + log.info("Not starting the Serena dashboard viewer because no usable display was detected.") + return + url = self.get_dashboard_url() assert url is not None if SerenaDashboardViewer.is_current_platform_supported(): process = multiprocessing.Process(target=self._start_dashboard_viewer_process_function, args=(url, minimized), daemon=True) process.start() else: + log.info("Not starting Serena dashboard viewer because the current platform does not support it; using browser-based fallback") if not minimized: self._open_dashboard_in_browser(url)