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]

Update swe-agent to use swe-rex python_standalone_dir for faster start ups

carlosejimenezd72816787b01
diff --git a/pyproject.toml b/pyproject.toml
index 6313c1fe..cec0ab04 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -56,7 +56,7 @@ dependencies = [
"litellm",
"GitPython",
"ghapi",
- "swe-rex"
+ "swe-rex>=1.0.3"
]
[project.scripts]
diff --git a/sweagent/environment/swe_env.py b/sweagent/environment/swe_env.py
index 7001c2df..5d7cea52 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="python:3.11"),
+ default_factory=lambda: DockerDeploymentConfig(image="python:3.11", python_standalone_dir="/root"),
description="Deployment options.",
)
repo: RepoConfig | None = Field(
diff --git a/sweagent/run/batch_instances.py b/sweagent/run/batch_instances.py
index 0a8f45fc..80a46e18 100644
--- a/sweagent/run/batch_instances.py
+++ b/sweagent/run/batch_instances.py
@@ -149,6 +149,7 @@ class SimpleBatchInstance(BaseModel):
env=EnvironmentConfig(deployment=deployment, repo=repo), problem_statement=problem_statement
)
deployment.image = self.image_name # type: ignore
+ deployment.python_standalone_dir = "/root" # type: ignore
return BatchInstance(
env=EnvironmentConfig(deployment=deployment, repo=repo), problem_statement=problem_statement
)