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]
Remove implicit flags
carlosejimenezd3fb277c896e
diff --git a/sweagent/run/run_batch.py b/sweagent/run/run_batch.pyindex 4d4ecc14..6922f2b8 100644--- a/sweagent/run/run_batch.py+++ b/sweagent/run/run_batch.py@@ -42,7 +42,7 @@ from sweagent.utils.log import ()-class RunBatchConfig(BaseSettings, cli_implicit_flags=True):+class RunBatchConfig(BaseSettings, cli_implicit_flags=False):instances: BatchInstanceSourceConfig = Field(description="Instances to run.")agent: AgentConfig = Field(description="Agent options.")output_dir: Path = Field(default=Path("DEFAULT"), description="Output directory.")diff --git a/sweagent/run/run_single.py b/sweagent/run/run_single.pyindex fbd2f3ba..77a8827c 100644--- a/sweagent/run/run_single.py+++ b/sweagent/run/run_single.py@@ -52,7 +52,7 @@ from sweagent.utils.config import load_environment_variablesfrom sweagent.utils.log import add_file_handler, get_logger-class RunSingleActionConfig(BaseModel, cli_implicit_flags=True):+class RunSingleActionConfig(BaseModel, cli_implicit_flags=False):"""Run real-life actions (opening PRs, etc.) if we can solve the issue."""# Open a PR with the patch if we can solve the issue@@ -62,7 +62,7 @@ class RunSingleActionConfig(BaseModel, cli_implicit_flags=True):apply_patch_locally: bool = False-class RunSingleConfig(BaseSettings, cli_implicit_flags=True):+class RunSingleConfig(BaseSettings, cli_implicit_flags=False):env: EnvironmentConfig = Field(default_factory=EnvironmentConfig, description="Environment options.")agent: AgentConfig = Field(description="Agent options.")problem_statement: ProblemStatementConfig = Field(diff --git a/tests/test_data/trajectories/gpt4__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/6e44b9__sweagenttestrepo-1c2844.traj b/tests/test_data/trajectories/gpt4__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/6e44b9__sweagenttestrepo-1c2844.trajindex 2ec1262d..058d4258 100644--- a/tests/test_data/trajectories/gpt4__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/6e44b9__sweagenttestrepo-1c2844.traj+++ b/tests/test_data/trajectories/gpt4__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/6e44b9__sweagenttestrepo-1c2844.traj@@ -251,19 +251,19 @@},"bundles": [{- "path": "/Users/fuchur/Documents/24/git_sync/SWE-agent/tools/defaults",+ "path": "tools/defaults","hidden_tools": []},{- "path": "/Users/fuchur/Documents/24/git_sync/SWE-agent/tools/search",+ "path": "tools/search","hidden_tools": []},{- "path": "/Users/fuchur/Documents/24/git_sync/SWE-agent/tools/edit_replace",+ "path": "tools/edit_replace","hidden_tools": []},{- "path": "/Users/fuchur/Documents/24/git_sync/SWE-agent/tools/submit",+ "path": "tools/submit","hidden_tools": []}],@@ -314,7 +314,6 @@"type": "github","id": "SWE-agent__test-repo-i1"},- "output_dir": "/Users/fuchur/Documents/24/git_sync/SWE-agent/trajectories/fuchur/config/function_calling_replace.yaml__gpt-4o__t-1.00__p-1.00__c-3.00___SWE-agent__test-repo-i1","actions": {"open_pr": false,"pr_config": {diff --git a/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yaml b/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yamlindex 50818f92..c5fb79e4 100644--- a/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yaml+++ b/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yaml@@ -506,7 +506,7 @@ agent:environment:base_commit: nullcontainer_name: null- data_path: /Users/fuchur/Documents/24/git_sync/SWE-agent/tests/test_data/data_sources/swe-bench-dev-easy_first_only.json+ data_path: tests/test_data/data_sources/swe-bench-dev-easy_first_only.jsonenvironment_setup: nullimage_name: sweagent/swe-agent:latestinstall_environment: truediff --git a/tests/test_run_batch.py b/tests/test_run_batch.pyindex b9c0418f..be938f37 100644--- a/tests/test_run_batch.py+++ b/tests/test_run_batch.py@@ -20,6 +20,7 @@ def test_expert_instances(test_data_sources_path: Path, tmp_path: Path):"--output_dir",str(tmp_path),"--raise_exceptions",+ "True",]main(cmd)for _id in ["simple_test_problem", "simple_test_problem_2"]:@@ -39,6 +40,7 @@ def test_simple_instances(test_data_sources_path: Path, tmp_path: Path):"--output_dir",str(tmp_path),"--raise_exceptions",+ "True",]main(cmd)assert (tmp_path / "simple_test_problem.traj").exists(), list(tmp_path.iterdir())@@ -56,6 +58,7 @@ def test_empty_instances_simple(test_data_sources_path: Path, tmp_path: Path):"--output_dir",str(tmp_path),"--raise_exceptions",+ "True","--instances.filter","doesnotmatch",]@@ -77,6 +80,7 @@ def test_empty_instances_expert(test_data_sources_path: Path, tmp_path: Path):"--output_dir",str(tmp_path),"--raise_exceptions",+ "True","--instances.filter","doesnotmatch",]