Skip to content

Commit 2b43dd6

Browse files
committed
Hotfix: don't start dashboard twice in process-isolated setting
1 parent 9087f42 commit 2b43dd6

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

src/serena/process_isolated_agent.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,15 @@ def _handle_request(self, request: dict[str, Any]) -> dict[str, Any]:
267267

268268
def _initialize(self, params: dict[str, Any]) -> dict[str, Any]:
269269
"""Initialize the SerenaAgent."""
270+
if self.agent is not None:
271+
return {"result": "SerenaAgent already initialized"}
270272
try:
271273
# Extract all possible initialization parameters
272274
context_param = params.get("context")
273275
project = params.get("project")
274276
serena_config = SerenaConfig.from_json_dict(params["serena_config"])
275277
context = SerenaAgentContext.from_json_dict(context_param) if context_param is not None else None
276278
modes = [SerenaAgentMode.from_json_dict(m) for m in params["modes"]]
277-
enable_web_dashboard = params.get("enable_web_dashboard")
278-
enable_gui_log_window = params.get("enable_gui_log_window")
279279
log_level = params.get("log_level")
280280
trace_lsp_communication = params.get("trace_lsp_communication")
281281
tool_timeout = params.get("tool_timeout")
@@ -285,8 +285,8 @@ def _initialize(self, params: dict[str, Any]) -> dict[str, Any]:
285285
serena_config=serena_config,
286286
context=context,
287287
modes=modes,
288-
enable_web_dashboard=enable_web_dashboard,
289-
enable_gui_log_window=enable_gui_log_window,
288+
enable_web_dashboard=False,
289+
enable_gui_log_window=False,
290290
log_level=log_level,
291291
trace_lsp_communication=trace_lsp_communication,
292292
tool_timeout=tool_timeout,
@@ -399,8 +399,6 @@ def __init__(
399399
serena_config: SerenaConfigBase | None = None,
400400
context: SerenaAgentContext | None = None,
401401
modes: list[SerenaAgentMode] | None = None,
402-
enable_web_dashboard: bool | None = None,
403-
enable_gui_log_window: bool | None = None,
404402
log_level: Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] | None = None,
405403
trace_lsp_communication: bool | None = None,
406404
tool_timeout: float | None = None,
@@ -409,8 +407,6 @@ def __init__(
409407
self.serena_config = serena_config or SerenaConfig.from_config_file()
410408
self.context = context
411409
self.modes = modes or []
412-
self.enable_web_dashboard = enable_web_dashboard
413-
self.enable_gui_log_window = enable_gui_log_window
414410
self.log_level = log_level
415411
self.trace_lsp_communication = trace_lsp_communication
416412
self.tool_timeout = tool_timeout
@@ -440,8 +436,6 @@ def start(self) -> None:
440436
"serena_config": self.serena_config.to_json_dict(),
441437
"context": self.context.to_json_dict() if self.context is not None else None,
442438
"modes": [m.to_json_dict() for m in self.modes],
443-
"enable_web_dashboard": self.enable_web_dashboard,
444-
"enable_gui_log_window": self.enable_gui_log_window,
445439
"log_level": self.log_level,
446440
"trace_lsp_communication": self.trace_lsp_communication,
447441
"tool_timeout": self.tool_timeout,

0 commit comments

Comments
 (0)