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]

Add flag to raise exceptions in run.py

Kilian Lieretbdd5c4c10cee
diff --git a/run.py b/run.py
index 025370f0..8b08dd19 100644
--- a/run.py
+++ b/run.py
@@ -62,6 +62,8 @@ class ScriptArguments(FlattenedAccess, FrozenSerializable):
instance_filter: str = ".*" # Only run instances that completely match this regex
skip_existing: bool = True # Skip instances with existing trajectories
suffix: str = ""
+ # Raise unhandled exceptions during the run (useful for debugging)
+ raise_exceptions: bool = False
@property
def run_name(self):
@@ -148,6 +150,8 @@ def main(args: ScriptArguments):
except Exception as e:
traceback.print_exc()
logger.warning(f"❌ Failed on {env.record['instance_id']}: {e}")
+ if args.raise_exceptions:
+ raise e
env.reset_container()
continue