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(human model): Handle empty commands
Kilian Lieret0bbe9223c940
diff --git a/sweagent/agent/models.py b/sweagent/agent/models.pyindex a779b47d..f361ce49 100644--- a/sweagent/agent/models.py+++ b/sweagent/agent/models.py@@ -375,7 +375,7 @@ class HumanModel(AbstractModel):else:# Input has escaped things like \n, so we need to unescape itaction = action.encode("utf8").decode("unicode_escape")- if action.strip().split()[0] == "spend_money":+ if action.strip() and action.strip().split()[0] == "spend_money":money = float(action.strip().split()[1])self.stats.instance_cost += moneyaction = f"echo 'Spent {money} dollars'"