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]
Enh: Do not extract exit code where not needed
Kilian Lieret17ba9d82de5e
diff --git a/sweagent/environment/swe_env.py b/sweagent/environment/swe_env.pyindex d642ffad..7457352c 100644--- a/sweagent/environment/swe_env.py+++ b/sweagent/environment/swe_env.py@@ -166,6 +166,7 @@ class SWEEnv:def interrupt_session(self):asyncio.run(self.deployment.runtime.run_in_session(BashInterruptAction()))+ # todo: return exit code?def communicate(self,input: str,@@ -189,7 +190,10 @@ class SWEEnv:output: output from container"""self.logger.log(logging.TRACE, "Input:\n%s", input) # type: ignore- r = asyncio.run(self.deployment.runtime.run_in_session(BashAction(command=input, timeout=timeout)))+ rex_check = "silent" if check else "ignore"+ r = asyncio.run(+ self.deployment.runtime.run_in_session(BashAction(command=input, timeout=timeout, check=rex_check))+ )output = r.outputself.logger.log(logging.TRACE, "Output:\n%s", output) # type: ignoreif check and r.exit_code != 0:@@ -203,7 +207,9 @@ class SWEEnv:# handling.last_action_string = shlex.quote(input.strip())input = f"export LAST_ACTION={last_action_string}"- r = asyncio.run(self.deployment.runtime.run_in_session(BashAction(command=input, timeout=1)))+ r = asyncio.run(+ self.deployment.runtime.run_in_session(BashAction(command=input, timeout=1, check="ignore"))+ )return output# todo: Use the runtime for this instead