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]
Web enh: Make sure that killing thread succeeds
Kilian Lieret8567a299817e
diff --git a/run.py b/run.pyindex 905ef5c9..4a2ebfd5 100644--- a/run.py+++ b/run.py@@ -360,6 +360,9 @@ class Main:logger.info("Exiting InterCode environment...")self.env.close()break+ except SystemExit:+ logger.critical(f"❌ Exiting because SystemExit was called")+ raiseexcept Exception as e:traceback.print_exc()if self.args.raise_exceptions:diff --git a/sweagent/api/server.py b/sweagent/api/server.pyindex 2cd50ed0..ef8fad9d 100644--- a/sweagent/api/server.py+++ b/sweagent/api/server.py@@ -1,5 +1,6 @@from contextlib import redirect_stderr, redirect_stdoutimport os+import timefrom typing import Dictfrom flask import Flask, render_template, request, make_responseimport sys@@ -63,7 +64,9 @@ class MainThread(ThreadWithExc):self._main.main()def stop(self):- self.raise_exc(SystemExit)+ while self.is_alive():+ self.raise_exc(SystemExit)+ time.sleep(0.1)@app.route('/')