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: saving trajectory

Kilian Lieret55487b7fdad9
diff --git a/sweagent/agent/agents.py b/sweagent/agent/agents.py
index bef52027..4faf709f 100644
--- a/sweagent/agent/agents.py
+++ b/sweagent/agent/agents.py
@@ -490,8 +490,8 @@ class Agent:
return attempt_data
data = {
- **get_attempt_data(-1),
- "attempts": [get_attempt_data(i) for i in range(self._i_attempt)],
+ **get_attempt_data(self._i_attempt),
+ "attempts": [get_attempt_data(i) for i in range(self._i_attempt + 1)],
}
assert self.traj_path is not None