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]
Move default images sweagent/swe-agent:lateset to python:3.11
carlosejimenezb06231d37575
diff --git a/sweagent/environment/swe_env.py b/sweagent/environment/swe_env.pyindex 56367df4..83e49011 100644--- a/sweagent/environment/swe_env.py+++ b/sweagent/environment/swe_env.py@@ -18,7 +18,7 @@ class EnvironmentConfig(BaseModel):"""Configure data sources and setup instructions for the environment in which we solve the tasks."""deployment: DeploymentConfig = Field(- default_factory=lambda: DockerDeploymentConfig(image="sweagent/swe-agent:latest"),+ default_factory=lambda: DockerDeploymentConfig(image="python:3.11"),description="Deployment options.",)repo: RepoConfig | None = Field(diff --git a/sweagent/run/batch_instances.py b/sweagent/run/batch_instances.pyindex 2042abcb..9c324dc2 100644--- a/sweagent/run/batch_instances.py+++ b/sweagent/run/batch_instances.py@@ -169,7 +169,7 @@ class InstancesFromFile(BaseModel, AbstractInstanceSource):"""Shuffle the instances (before filtering and slicing)."""deployment: DeploymentConfig = Field(- default_factory=lambda: DockerDeploymentConfig(image="sweagent/swe-agent:latest"),+ default_factory=lambda: DockerDeploymentConfig(image="python:3.11"),description="Deployment options.",)"""Note that the image_name option is overwritten by the images specified in the task instances."""@@ -207,7 +207,7 @@ class InstancesFromHuggingFace(BaseModel, AbstractInstanceSource):"""Shuffle the instances (before filtering and slicing)."""deployment: DeploymentConfig = Field(- default_factory=lambda: DockerDeploymentConfig(image="sweagent/swe-agent:latest"),+ default_factory=lambda: DockerDeploymentConfig(image="python:3.11"),description="Deployment options.",)"""Deployment configuration. Note that the image_name option is overwritten by the images specified in the task instances.@@ -236,7 +236,7 @@ class SWEBenchInstances(BaseModel, AbstractInstanceSource):split: Literal["dev", "test"] = "dev"deployment: DeploymentConfig = Field(- default_factory=lambda: DockerDeploymentConfig(image="sweagent/swe-agent:latest"),+ default_factory=lambda: DockerDeploymentConfig(image="python:3.11"),description="Deployment options.",)"""Deployment configuration. Note that the image_name option is overwritten by the images specified in the task instances.diff --git a/tests/conftest.py b/tests/conftest.pyindex 09970cc8..2dcd05e4 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -82,7 +82,7 @@ def test_env_args(clone_cmd = ["git", "clone", "https://github.com/swe-agent/test-repo", str(local_repo_path)]subprocess.run(clone_cmd, check=True)test_env_args = EnvironmentConfig(- deployment=DockerDeploymentConfig(image="sweagent/swe-agent:latest"),+ deployment=DockerDeploymentConfig(image="python:3.11"),repo=LocalRepoConfig(path=local_repo_path),)yield test_env_argsdiff --git a/tests/test_batch_instance.py b/tests/test_batch_instance.pyindex 1046762c..fbe1e8de 100644--- a/tests/test_batch_instance.py+++ b/tests/test_batch_instance.py@@ -11,7 +11,7 @@ from sweagent.run.batch_instances import BatchInstance, SimpleBatchInstance, SWEdef test_simple_batch_from_swe_bench_to_full_batch_instance(test_data_sources_path):sb_instance = json.loads((test_data_sources_path / "swe-bench-dev-easy.json").read_text())[0]instance = SimpleBatchInstance.from_swe_bench(sb_instance).to_full_batch_instance(- DockerDeploymentConfig(image="sweagent/swe-agent:latest")+ DockerDeploymentConfig(image="python:3.11"))assert isinstance(instance.env.repo, PreExistingRepo)assert instance.env.repo.repo_name == "testbed"diff --git a/tests/test_models.py b/tests/test_models.pyindex 6b1f20b7..de33f55f 100644--- a/tests/test_models.py+++ b/tests/test_models.py@@ -11,9 +11,10 @@ from sweagent.types import Historydef test_litellm_mock():model = get_model(GenericAPIModelConfig(- name="anthropic/o1-preview",+ name="o1-preview",completion_kwargs={"mock_response": "Hello, world!"},api_key=SecretStr("dummy_key"),+ top_p=None,),ToolConfig(parse_function=Identity(),diff --git a/tests/test_run_replay.py b/tests/test_run_replay.pyindex e63d1375..1e2b7713 100644--- a/tests/test_run_replay.py+++ b/tests/test_run_replay.py@@ -15,7 +15,7 @@ def rr_config(swe_agent_test_repo_traj, tmp_path, swe_agent_test_repo_clone):return RunReplayConfig(traj_path=swe_agent_test_repo_traj,config_path=CONFIG_DIR / "default_from_url.yaml",- deployment=DockerDeploymentConfig(image="sweagent/swe-agent:latest"),+ deployment=DockerDeploymentConfig(image="python:3.11"),output_dir=tmp_path,repo=LocalRepoConfig(path=swe_agent_test_repo_clone),)