Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

make sure that we don't kill the interactive session when we timeout in another command

Talor Abramovich55485684ca7d
diff --git a/sweagent/environment/swe_env.py b/sweagent/environment/swe_env.py
index 2a18c2c2..b9f928a0 100644
--- a/sweagent/environment/swe_env.py
+++ b/sweagent/environment/swe_env.py
@@ -1376,7 +1376,7 @@ class SWEEnv(gym.Env):
assert self.container_obj is not None
pids = self.get_pids()
for pid, cmd in pids:
- if pid not in self.parent_pids and cmd != "ps":
+ if pid not in self.parent_pids and cmd != "ps" and cmd != getattr(self.interactive_session, "name", None):
self.container_obj.exec_run(f"kill -9 {pid}")
try:
_ = read_with_timeout(self.container, self.get_pids, 20)