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]

Enh: Print complete list of instances and exit status at end

Kilian Lieret66857f34c4a8
diff --git a/sweagent/run/_progress.py b/sweagent/run/_progress.py
index 1220f99f..59285969 100644
--- a/sweagent/run/_progress.py
+++ b/sweagent/run/_progress.py
@@ -107,3 +107,10 @@ class RunBatchProgressManager:
def on_uncaught_exception(self, instance_id: str, exception: Exception):
self.on_instance_end(instance_id, f"Uncaught {type(exception).__name__}")
+
+ def print_report(self) -> None:
+ """Print complete list of instances and their exit statuses."""
+ for status, instances in self._instances_by_exit_status.items():
+ print(f"{status}: {len(instances)}")
+ for instance in instances:
+ print(f" {instance}")
diff --git a/sweagent/run/run_batch.py b/sweagent/run/run_batch.py
index da9063f4..2e3f0358 100644
--- a/sweagent/run/run_batch.py
+++ b/sweagent/run/run_batch.py
@@ -172,6 +172,8 @@ class RunBatch:
executor.shutdown(wait=False, cancel_futures=True)
raise _BreakLoop
+ self._progress_manager.print_report()
+
def run_instance(self, instance: BatchInstance):
self._progress_manager.on_instance_start(instance.problem_statement.id)