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]

added handling for the case when the process exited and we still check for output

Talor Abramovich36a4f294740e
diff --git a/sweagent/environment/utils.py b/sweagent/environment/utils.py
index c04332e5..d594f674 100644
--- a/sweagent/environment/utils.py
+++ b/sweagent/environment/utils.py
@@ -331,7 +331,7 @@ def read_session_with_timeout(
return bool(select.select([fd], [], [], 0.01)[0])
command_done = False
- while time.time() < min(end_time, end_time_no_output):
+ while time.time() < min(end_time, end_time_no_output) and session.poll() is None:
if ready_to_read(fd):
try:
data = os.read(fd, 4096)