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]

Breaking: Remove review_on_submit (replaced by review_on_submit_m) (#1148)

Kilian Lieret1effb7deca8c
diff --git a/tools/review_on_submit/README.md b/tools/review_on_submit/README.md
deleted file mode 100644
index 131667da..00000000
--- a/tools/review_on_submit/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# Review on submit.
-
-Provides an alternative for `submit` that does not immediately submit, but asks the
-agent to perform additional reviewing steps.
-
-Only `submit -f` will trigger the real submit.
\ No newline at end of file
diff --git a/tools/review_on_submit/bin/submit b/tools/review_on_submit/bin/submit
deleted file mode 100644
index 3d8b1d76..00000000
--- a/tools/review_on_submit/bin/submit
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python3
-
-import argparse
-from pathlib import Path
-import subprocess
-import sys
-import os
-import io
-
-from registry import registry
-
-
-def main() -> None:
- parser = argparse.ArgumentParser(description="Submit changes for review")
- parser.add_argument("-f", "--force", action="store_true", help="Force submit without review")
- args = parser.parse_args()
-
- repo_root = registry.get("ROOT", os.getenv("ROOT"))
- assert repo_root
-
- patch_path = Path("/root/model.patch")
-
- subprocess.run(
- f"git add -A && git diff --cached > {patch_path}",
- shell=True,
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- cwd=repo_root,
- )
-
- patch = patch_path.read_text(encoding="utf-8", errors="backslashreplace")
-
- if not args.force and not registry.get("SUBMIT_TRIGGERED_BEFORE"):
- message = registry.get("SUBMIT_REVIEW_MESSAGE", "")
- message = message.replace("{{diff}}", patch)
- message = message.replace("{{problem_statement}}", registry.get("PROBLEM_STATEMENT", ""))
- registry["SUBMIT_TRIGGERED_BEFORE"] = True
- # work around any encoding issues
- message = message.encode("utf-8", errors="backslashreplace").decode("utf-8")
- print(message)
- sys.exit(0)
-
- print("<<SWE_AGENT_SUBMISSION>>")
- print(patch)
- print("<<SWE_AGENT_SUBMISSION>>")
-
-
-if __name__ == "__main__":
- # There are some super strange "ascii can't decode x" errors when printing to the terminal
- # that can be solved with setting the default encoding for stdout
- # (note that python3.6 doesn't have the reconfigure method)
- sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
- main()
diff --git a/tools/review_on_submit/config.yaml b/tools/review_on_submit/config.yaml
deleted file mode 100644
index a7cc0f86..00000000
--- a/tools/review_on_submit/config.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-tools:
- submit:
- signature: "submit"
- docstring: "submits the current file"
- # Do not actually show the -f argument to the model, only
- # use it from the agent for submission after error
diff --git a/tools/review_on_submit/install.sh b/tools/review_on_submit/install.sh
deleted file mode 100644
index e69de29b..00000000