Merge remote-tracking branch 'origin/main' into restructure-agent-py

Conflicts:
	src/serena/agent.py
This commit is contained in:
Dominik Jain
2025-07-02 23:31:04 +02:00
committed by Dominik Jain
3 changed files with 8 additions and 5 deletions
+1
View File
@@ -224,6 +224,7 @@ ignore = [
"TID252", # forbids relative imports
"B904", # forces use of raise from other_exception
"RUF012", # forbids mutable attributes as ClassVar
"SIM117", # forbids nested with statements
]
unfixable = ["F841", "F601", "F602", "B018"]
extend-fixable = ["F401", "B905", "W291"]
+6 -1
View File
@@ -2,6 +2,7 @@
The Serena Model Context Protocol (MCP) Server
"""
import contextlib
import os
import platform
import sys
@@ -272,7 +273,11 @@ class SerenaAgent:
Logger.root.addHandler(dashboard_log_handler)
self._dashboard_thread, port = SerenaDashboardAPI(dashboard_log_handler, tool_names).run_in_thread()
if self.serena_config.web_dashboard_open_on_launch:
webbrowser.open(f"http://localhost:{port}/dashboard/index.html")
# open the dashboard URL in the default web browser, making sure to redirect output,
# as this can print to stdout (contaminating the MCP server stream)
with open(os.devnull, "w") as fnull:
with contextlib.redirect_stdout(fnull), contextlib.redirect_stderr(fnull):
webbrowser.open(f"http://localhost:{port}/dashboard/index.html")
# log fundamental information
log.info(f"Starting Serena server (version={serena_version()}, process id={os.getpid()}, parent process id={os.getppid()})")
+1 -4
View File
@@ -128,11 +128,8 @@ class SerenaDashboardAPI:
if self._shutdown_callback:
self._shutdown_callback()
else:
# Try to use the global shutdown function from process_isolated_agent
from serena.process_isolated_agent import request_global_shutdown
request_global_shutdown()
# noinspection PyProtectedMember
# noinspection PyUnresolvedReferences
os._exit(0)
@staticmethod