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 (str_replace_editor): Loading of empty file history

Kilian Lieretcb08a255fd15
diff --git a/tools/edit_anthropic/bin/str_replace_editor b/tools/edit_anthropic/bin/str_replace_editor
index 76b51af5..e6c900c9 100644
--- a/tools/edit_anthropic/bin/str_replace_editor
+++ b/tools/edit_anthropic/bin/str_replace_editor
@@ -86,7 +86,7 @@ class EditTool:
@property
def _file_history(self):
- return defaultdict(list, json.loads(REGISTRY["file_history"]))
+ return defaultdict(list, json.loads(REGISTRY.get("file_history", "{}")))
@_file_history.setter
def _file_history(self, value: dict):