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: More information on skipped exit status (#1117)

Kilian Lieret33b9325639ba
diff --git a/sweagent/run/run_batch.py b/sweagent/run/run_batch.py
index e37816f0..563d2a6e 100644
--- a/sweagent/run/run_batch.py
+++ b/sweagent/run/run_batch.py
@@ -298,8 +298,10 @@ class RunBatch:
self._progress_manager.on_instance_start(instance.problem_statement.id)
- if self.should_skip(instance):
- self._progress_manager.on_instance_end(instance.problem_statement.id, exit_status="skipped")
+ if previous_exit_status := self.should_skip(instance):
+ self._progress_manager.on_instance_end(
+ instance.problem_statement.id, exit_status=f"skipped ({previous_exit_status})"
+ )
self._remove_instance_log_file_handlers(instance.problem_statement.id)
return
@@ -371,8 +373,10 @@ class RunBatch:
self._chooks.on_instance_completed(result=result)
return result
- def should_skip(self, instance: BatchInstance) -> bool:
- """Check if we should skip this instance"""
+ def should_skip(self, instance: BatchInstance) -> bool | str:
+ """Check if we should skip this instance.
+ Returns previous exit status if the instance should be skipped.
+ """
if self._redo_existing:
return False
@@ -402,7 +406,7 @@ class RunBatch:
return False
# otherwise, we will skip it
self.logger.info(f"⏭️ Skipping existing trajectory: {log_path}")
- return True
+ return exit_status
def _add_instance_log_file_handlers(self, instance_id: str, multi_worker: bool = False) -> None:
filename_template = f"{instance_id}.{{level}}.log"