Add config item web_dashboard_open_on_launch

This commit is contained in:
Dominik Jain
2025-07-02 11:13:35 +02:00
committed by Dominik Jain
parent cbcbb5c8a5
commit 5edf905833
3 changed files with 12 additions and 1 deletions
+2
View File
@@ -20,6 +20,8 @@ Status of the `main` branch. Changes prior to the next official version change w
* Language support:
* Better support for C# by switching from `omnisharp` to Microsoft's official C# language server.
* **Add support for Clojure**
* Configuration:
* Add option `web_dashboard_open_on_launch` (allowing the dashboard to be enabled without opening a browser window)
Fixes:
* Fix `ExecuteShellCommandTool` and `GetCurrentConfigTool` hanging on Windows
+4 -1
View File
@@ -275,6 +275,7 @@ class SerenaConfigBase(ABC):
log_level: int = logging.INFO
trace_lsp_communication: bool = False
web_dashboard: bool = True
web_dashboard_open_on_launch: bool = True
tool_timeout: float = DEFAULT_TOOL_TIMEOUT
@cached_property
@@ -446,6 +447,7 @@ class SerenaConfig(SerenaConfigBase):
instance.gui_log_window_enabled = loaded_commented_yaml.get("gui_log_window", False)
instance.log_level = loaded_commented_yaml.get("log_level", loaded_commented_yaml.get("gui_log_level", logging.INFO))
instance.web_dashboard = loaded_commented_yaml.get("web_dashboard", True)
instance.web_dashboard_open_on_launch = loaded_commented_yaml.get("web_dashboard_open_on_launch", True)
instance.tool_timeout = loaded_commented_yaml.get("tool_timeout", DEFAULT_TOOL_TIMEOUT)
instance.trace_lsp_communication = loaded_commented_yaml.get("trace_lsp_communication", False)
@@ -792,7 +794,8 @@ class SerenaAgent:
dashboard_log_handler = MemoryLogHandler(level=serena_log_level)
Logger.root.addHandler(dashboard_log_handler)
self._dashboard_thread, port = SerenaDashboardAPI(dashboard_log_handler, tool_names).run_in_thread()
webbrowser.open(f"http://localhost:{port}/dashboard/index.html")
if self.serena_config.web_dashboard_open_on_launch:
webbrowser.open(f"http://localhost:{port}/dashboard/index.html")
log.info(f"Starting Serena server (version={serena_version()}, process id={os.getpid()}, parent process id={os.getppid()})")
log.info("Available projects: {}".format(", ".join(self.serena_config.project_names)))
@@ -20,6 +20,12 @@ web_dashboard: True
# shows Serena's current session logs - as an alternative to the GUI log window which
# is supported on all platforms.
web_dashboard_open_on_launch: True
# whether to open a browser window with the web dashboard when Serena starts (provided that web_dashboard
# is enabled). If set to False, you can still open the dashboard manually by navigating to
# http://localhost:24282/dashboard/ in your web browser.
# If you have multiple instances running, a higher port will be used; try port 24283, 24284, etc.
log_level: 20
# the minimum log level for the GUI log window and the dashboard (10 = debug, 20 = info, 30 = warning, 40 = error)