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]

Change: sparse clone method is now correctly called "shallow" (#591)

Kilian Lieretcafece1f539b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 77b9faab..62b00103 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,9 +6,9 @@
**We sped up SWE-agent by 2x** (timed with GPT4o). This is mostly due to faster communication with the running processes inside of the Docker container and other container setup & installation related improvements. Here are a few relevant PRs:
-* Switch to fast communicate and sparse clone by default by [@klieret](https://github.com/klieret) in [#530](https://github.com/princeton-nlp/SWE-agent/pull/530)
+* Switch to fast communicate and shallow clone by default by [@klieret](https://github.com/klieret) in [#530](https://github.com/princeton-nlp/SWE-agent/pull/530)
* Change: Only wait 1s for docker to start by [@klieret](https://github.com/klieret) in [#541](https://github.com/princeton-nlp/SWE-agent/pull/541)
-* Feat: experimental sparse cloning by [@klieret](https://github.com/klieret) in [#498](https://github.com/princeton-nlp/SWE-agent/pull/498)
+* Feat: experimental shallow cloning by [@klieret](https://github.com/klieret) in [#498](https://github.com/princeton-nlp/SWE-agent/pull/498)
* Enh: Start from clone of python conda environment for speedup by [@klieret](https://github.com/klieret) in [#548](https://github.com/princeton-nlp/SWE-agent/pull/548)
* Enh: Use uv for editable install by default by [@klieret](https://github.com/klieret) in [#547](https://github.com/princeton-nlp/SWE-agent/pull/547)
diff --git a/docs/config/env.md b/docs/config/env.md
index 4de66032..fb6630ff 100644
--- a/docs/config/env.md
+++ b/docs/config/env.md
@@ -15,5 +15,5 @@ This page details all environment variables that are currently in use by SWE-age
The following variables might still be subject to change
* `SWE_AGENT_COMMUNICATE_METHOD`: Determines how SWE-agent communicates with the running process in the docker container: `end-marker` (default, fast) or `processes` (legacy, slow, more tested)
-* `SWE_AGENT_CLONE_METHOD`: `sparse` (default) or `full`. When using persistent containers or running over multiple problem statements, we fall back to `full`.
+* `SWE_AGENT_CLONE_METHOD`: `shallow` (default, only retrieves relevant commit) or `full` (clones repository including full history). When using persistent containers or running over multiple problem statements, we fall back to `full`.
* `SWE_AGENT_DOCKER_START_UP_DELAY`: Number of seconds to wait after starting a docker container
diff --git a/sweagent/environment/swe_env.py b/sweagent/environment/swe_env.py
index f1ccf997..07ae8440 100644
--- a/sweagent/environment/swe_env.py
+++ b/sweagent/environment/swe_env.py
@@ -243,7 +243,7 @@ class SWEEnv(gym.Env):
else:
self.logger.info("Trying to clone from non-mirror...")
clone_url = f"https://{token_prefix}github.com/{self.record['repo']}.git"
- clone_method = keys_config.get("SWE_AGENT_CLONE_METHOD", default="sparse", choices=["sparse", "full"])
+ clone_method = keys_config.get("SWE_AGENT_CLONE_METHOD", default="shallow", choices=["shallow", "full"])
if len(self.data) > 1 or self.persistent:
msg = "Falling back to full cloning method due to multiple instances or persistent container"
clone_method = "full"