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]
Fix: Working with github urls
Kilian Lieret077735f0d756
diff --git a/sweagent/environment/swe_env.py b/sweagent/environment/swe_env.pyindex 3db31d64..c50ae1e4 100644--- a/sweagent/environment/swe_env.py+++ b/sweagent/environment/swe_env.py@@ -120,7 +120,8 @@ class GithubRepoConfig(BaseModel):"""Prepend github token to URL"""if "@" in self.url:return self.url- return f"https://{token}@{self.url}"+ _, _, url_no_protocol = self.url.partition("://")+ return f"https://{token}@{url_no_protocol}"RepoConfig = LocalRepoConfig | GithubRepoConfig@@ -249,7 +250,7 @@ class SWEEnv(gym.Env):else:base_commit = self.args.repo.base_commitself.communicate_with_handling(- input="&&".join(+ input=" && ".join((f"mkdir {self.args.repo.repo_name}",f"cd {self.args.repo.repo_name}",