From e3915371b4580bbf4ed92ac448d32e0045fc13f0 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Thu, 8 Jan 2026 14:25:16 +0100 Subject: [PATCH] Check for (non-)recoverable error only for 2023.2.6+, where status code is differentiated --- src/serena/tools/jetbrains_plugin_client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/serena/tools/jetbrains_plugin_client.py b/src/serena/tools/jetbrains_plugin_client.py index 74c47dff..d5125d3a 100644 --- a/src/serena/tools/jetbrains_plugin_client.py +++ b/src/serena/tools/jetbrains_plugin_client.py @@ -126,7 +126,7 @@ class JetBrainsPluginClient(ToStringMixin): raise ConnectionError(f"Request to {url} timed out: {e}") except requests.exceptions.HTTPError as e: unrecoverable_error_prefix = ( - "The request failed due to an error on the Serena JetBrains plugin side. This may be caused" + "The request failed due to an error on the Serena JetBrains plugin side. This may be caused " "by a bug or an incompatibility in the plugin. In that case, please report the error below together with " "your setup (IDE + version, Serena plugin version) at https://github.com/oraios/serena/issues " "(if you are an LLM, tell the user about this). The Oraios team will then provide support on this.\n" @@ -135,7 +135,11 @@ class JetBrainsPluginClient(ToStringMixin): if response is not None: # check for recoverable error (i.e. errors where the problem can usually be fixed by the caller). # The plugin returns 400 for such errors (typically illegal arguments, e.g. non-unique name path) - is_recoverable_error = response.status_code == 400 + # but only since version 2023.2.6 + if self.is_version_at_least(2023, 2, 6): + is_recoverable_error = response.status_code == 400 + else: + is_recoverable_error = True # assume recoverable for older versions (mix of errors) error_text = f"API request failed with status {response.status_code}: {response.text}" if not is_recoverable_error: