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]

Fix small bug for local repo (#1295)

Pan Yinxu1aa6b367f5b8
diff --git a/sweagent/environment/repo.py b/sweagent/environment/repo.py
index 3533b6dc..d32d389f 100644
--- a/sweagent/environment/repo.py
+++ b/sweagent/environment/repo.py
@@ -110,7 +110,9 @@ class LocalRepoConfig(BaseModel):
asyncio.run(
deployment.runtime.upload(UploadRequest(source_path=str(self.path), target_path=f"/{self.repo_name}"))
)
- r = asyncio.run(deployment.runtime.execute(Command(command=f"chown -R root:root {self.repo_name}", shell=True)))
+ r = asyncio.run(
+ deployment.runtime.execute(Command(command=f"chown -R root:root /{self.repo_name}", shell=True))
+ )
if r.exit_code != 0:
msg = f"Failed to change permissions on copied repository (exit code: {r.exit_code}, stdout: {r.stdout}, stderr: {r.stderr})"
raise RuntimeError(msg)