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]

Fix error on exit

carlosejimenez52d049160ae9
diff --git a/sweagent/agent/agents.py b/sweagent/agent/agents.py
index 1ce0e0ae..11d71751 100644
--- a/sweagent/agent/agents.py
+++ b/sweagent/agent/agents.py
@@ -547,6 +547,7 @@ class Agent:
step.done = True
step.observation = "Exited"
step.exit_status = "exit_command"
+ step.state = self.tools.get_state(env=self._env) # for history
return step
assert self._env is not None
@@ -756,8 +757,7 @@ class Agent:
self._chook.on_step_start()
step_output = self.forward_with_handling(self.local_history)
- if not step_output.done:
- self.add_step_to_history(step_output)
+ self.add_step_to_history(step_output)
self.info["submission"] = step_output.submission
self.info["exit_status"] = step_output.exit_status # type: ignore