From e266530c7d7ca316e1a522d59193811ee840959e Mon Sep 17 00:00:00 2001 From: alt-glitch Date: Sun, 15 Mar 2026 02:33:04 +0530 Subject: [PATCH] add different polling intervals for ssh and local backends. ssh has a longer roundtrip --- tools/environments/persistent_shell.py | 3 ++- tools/environments/ssh.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/environments/persistent_shell.py b/tools/environments/persistent_shell.py index df1a78ef..4b89db47 100644 --- a/tools/environments/persistent_shell.py +++ b/tools/environments/persistent_shell.py @@ -40,6 +40,7 @@ class PersistentShellMixin: def _cleanup_temp_files(self): ... _session_id: str = "" + _poll_interval: float = 0.01 @property def _temp_prefix(self) -> str: @@ -223,7 +224,7 @@ class PersistentShellMixin: ) self._send_to_shell(ipc_script) deadline = time.monotonic() + timeout - poll_interval = 0.15 + poll_interval = self._poll_interval while True: if is_interrupted(): diff --git a/tools/environments/ssh.py b/tools/environments/ssh.py index c48b3850..90532dda 100644 --- a/tools/environments/ssh.py +++ b/tools/environments/ssh.py @@ -77,6 +77,8 @@ class SSHEnvironment(PersistentShellMixin, BaseEnvironment): except subprocess.TimeoutExpired: raise RuntimeError(f"SSH connection to {self.user}@{self.host} timed out") + _poll_interval: float = 0.15 + @property def _temp_prefix(self) -> str: return f"/tmp/hermes-ssh-{self._session_id}"