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]

Do not attempt to save patch with empty patch (#242)

Danjie Tang5d938f0288de
diff --git a/run.py b/run.py
index 870b7bdc..bc93288a 100644
--- a/run.py
+++ b/run.py
@@ -274,7 +274,7 @@ def save_patch(traj_dir: Path, instance_id: str, info) -> Optional[Path]:
patch_output_dir = traj_dir / "patches"
patch_output_dir.mkdir(exist_ok=True, parents=True)
patch_output_file = patch_output_dir / f"{instance_id}.patch"
- if not "submission" in info:
+ if not info.get("submission"):
logger.info("No patch to save.")
return
model_patch = info["submission"]