From d7e4f7c6895ec8a85b747e5fc373ea56004b1cb7 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Mon, 12 Jan 2026 19:31:59 +0100 Subject: [PATCH 1/3] JetBrainsGetSymbolsOverviewTool: Allow to disable compact format for testing --- src/serena/tools/jetbrains_tools.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/serena/tools/jetbrains_tools.py b/src/serena/tools/jetbrains_tools.py index 6407de7c..aad111c1 100644 --- a/src/serena/tools/jetbrains_tools.py +++ b/src/serena/tools/jetbrains_tools.py @@ -101,6 +101,8 @@ class JetBrainsGetSymbolsOverviewTool(Tool, ToolMarkerSymbolicRead, ToolMarkerOp Retrieves an overview of the top-level symbols within a specified file using the JetBrains backend """ + USE_COMPACT_FORMAT = True + @staticmethod def _transform_symbols_to_compact_format(symbols: list[dict[str, Any]]) -> dict[str, list]: """ @@ -154,6 +156,9 @@ class JetBrainsGetSymbolsOverviewTool(Tool, ToolMarkerSymbolicRead, ToolMarkerOp with JetBrainsPluginClient.from_project(self.project) as client: response_dict = client.get_symbols_overview(relative_path=relative_path, depth=depth) symbols = response_dict["symbols"] - compact_symbols = self._transform_symbols_to_compact_format(symbols) - result = self._to_json(compact_symbols) + if self.USE_COMPACT_FORMAT: + compact_symbols = self._transform_symbols_to_compact_format(symbols) + result = self._to_json(compact_symbols) + else: + result = self._to_json(symbols) return self._limit_length(result, max_answer_chars) From 2b50c360e2d29a00a5a445ebe6f00256592230a4 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Tue, 13 Jan 2026 01:29:05 +0100 Subject: [PATCH 2/3] Dashboard: Fix free port search not using the proper listen address #929 --- src/serena/dashboard.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/serena/dashboard.py b/src/serena/dashboard.py index 1d937b73..7d1f6268 100644 --- a/src/serena/dashboard.py +++ b/src/serena/dashboard.py @@ -562,12 +562,12 @@ class SerenaDashboardAPI: self._agent.remove_language(language) @staticmethod - def _find_first_free_port(start_port: int) -> int: + def _find_first_free_port(start_port: int, host: str) -> int: port = start_port while port <= 65535: try: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: - sock.bind(("0.0.0.0", port)) + sock.bind((host, port)) return port except OSError: port += 1 @@ -587,7 +587,7 @@ class SerenaDashboardAPI: return port def run_in_thread(self, host: str) -> tuple[threading.Thread, int]: - port = self._find_first_free_port(0x5EDA) + port = self._find_first_free_port(0x5EDA, host) log.info("Starting dashboard (listen_address=%s, port=%d)", host, port) thread = threading.Thread(target=lambda: self.run(host=host, port=port), daemon=True) thread.start() From d75b41b6aea6366a7517ad839c8294a17f594cb9 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Tue, 13 Jan 2026 11:33:19 +0100 Subject: [PATCH 3/3] scan_directory: Catch exceptions due to relative path conversion (e.g. nul device file on Windows) #931 --- src/serena/util/file_system.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/serena/util/file_system.py b/src/serena/util/file_system.py index 784fc2cf..3784a17a 100644 --- a/src/serena/util/file_system.py +++ b/src/serena/util/file_system.py @@ -52,7 +52,11 @@ def scan_directory( entry_path = entry.path if rel_base: - result_path = os.path.relpath(entry_path, rel_base) + try: + result_path = os.path.relpath(entry_path, rel_base) + except: + log.debug(f"Skipping entry due to relative path conversion error: {entry.path}") + continue else: result_path = entry_path