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 default config files for reviewer

Kilian Lieretb8ed4367d4c8
diff --git a/config/default_retry.yaml b/config/default_retry.yaml
index f18bc4c8..4f5e0085 100644
--- a/config/default_retry.yaml
+++ b/config/default_retry.yaml
@@ -232,6 +232,6 @@ review_loop_config:
- scroll_down
traj_item_template: 'Step {i_step} thought:\n{response}\n\Step {i_step} output:\n{observation}'
max_samples: 10
- min_draws: 100
+ min_draws: 10
max_accepted_draws: 2
gtc_classname: GraveToCradle
diff --git a/sweagent/agent/reviewer.py b/sweagent/agent/reviewer.py
index 5dad8472..b7f7d43e 100644
--- a/sweagent/agent/reviewer.py
+++ b/sweagent/agent/reviewer.py
@@ -535,4 +535,12 @@ def get_review_loop_from_config(
if config is None:
logger.debug("Running without review loop")
return None
+ if not isinstance(config, ReviewLoopConfig):
+ msg = (
+ f"Expected a `ReviewLoopConfig`, got {config!r} of type {type(config)}. "
+ "This usually happens for misconfiguration issues: Make sure that all validation "
+ "conditions are satisfied (e.g., min draws <= max draws etc.) and that all "
+ "required keys are there."
+ )
+ raise ValueError(msg)
return globals()[config.review_loop_classname](config, instance, model)
diff --git a/tests/test_data/config_files/default_retry_no_breviewer.yaml b/tests/test_data/config_files/default_retry_no_breviewer.yaml
index a2afbc79..41c92dc5 100644
--- a/tests/test_data/config_files/default_retry_no_breviewer.yaml
+++ b/tests/test_data/config_files/default_retry_no_breviewer.yaml
@@ -140,6 +140,6 @@ review_loop_config:
{edited_files70}
```
max_samples: 10
- min_draws: 100
+ min_draws: 10
max_accepted_draws: 2
gtc_classname: GraveToCradle