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]

Default inspector dir is os.getcwd

Kilian Lieret28e799c8a87b
diff --git a/sweagent/inspector/server.py b/sweagent/inspector/server.py
index 6be3c496..f7900c9a 100644
--- a/sweagent/inspector/server.py
+++ b/sweagent/inspector/server.py
@@ -11,8 +11,6 @@ from typing import Any
import yaml
-from sweagent import TRAJECTORY_DIR
-
def append_exit(content):
last_entry = content["history"][-1]
@@ -308,15 +306,15 @@ def main(data_path, directory, port):
def get_parser():
parser = ArgumentParser()
parser.add_argument("--data_path", type=str, help="Path to dataset that was used for the trajectories")
- parser.add_argument("--directory", type=str, help="Directory to serve", default=TRAJECTORY_DIR, nargs="?")
+ parser.add_argument("--directory", type=str, help="Directory to serve", default=os.getcwd(), nargs="?")
parser.add_argument("--port", type=int, help="Port to serve", default=8000)
return parser
def run_from_cli(args: list[str] | None = None):
# Hack to make sure all the templates and all are found
- os.chdir(Path(__file__).parent)
parsed_args = get_parser().parse_args(args)
+ os.chdir(Path(__file__).parent)
main(**vars(parsed_args))