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(retry): Comparison index bookkeeping

Kilian Liereta91993788a01
diff --git a/sweagent/agent/reviewer.py b/sweagent/agent/reviewer.py
index b3b1827d..25237cda 100644
--- a/sweagent/agent/reviewer.py
+++ b/sweagent/agent/reviewer.py
@@ -526,7 +526,7 @@ class ReviewLoop(AbstractReviewLoop):
rev1=rev1,
rev2=rev2,
)
- self._comparisons.append((self._n_samples - 2, self._n_samples - 1, cresult))
+ self._comparisons.append((self._best_idx, self._n_samples - 1, cresult))
assert cresult.choice in [0, 1]
# this was a comparison between the current best and the last one
self._best_idx = [self._best_idx, self._n_samples - 1][cresult.choice]