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(tools): model.patch in patch breaks sb-cli eval
Kilian Lieret692aa8b9e7d8
diff --git a/tools/review_on_submit/bin/submit b/tools/review_on_submit/bin/submitindex 3ffc4f80..0d6b2be3 100644--- a/tools/review_on_submit/bin/submit+++ b/tools/review_on_submit/bin/submit@@ -1,6 +1,7 @@#!/usr/bin/env python3import argparse+from pathlib import Pathimport subprocessimport sysimport os@@ -16,19 +17,17 @@ def main() -> None:repo_root = registry.get("ROOT", os.getenv("ROOT"))assert repo_root- git_process = subprocess.run(- "git add -A && git diff --cached > /root/model.patch",+ patch_path = Path("/root/model.patch")++ subprocess.run(+ f"git add -A && git diff --cached > {patch_path}",shell=True,- stdout=subprocess.PIPE,- stderr=subprocess.PIPE,+ stdout=subprocess.DEVNULL,+ stderr=subprocess.DEVNULL,cwd=repo_root,)- with open("/root/model.patch") as f:- patch = f.read()-- with open("model.patch", "w") as f:- f.write(git_process.stdout.decode("utf-8"))+ patch = patch_path.read_text()if not args.force and not registry.get("SUBMIT_TRIGGERED_BEFORE"):message = registry.get("SUBMIT_REVIEW_MESSAGE", "")@@ -42,6 +41,8 @@ def main() -> None:print(patch)print("||SUBMISSION>>")+ patch_path.unlink()+if __name__ == "__main__":main()