fix: Retry tests on parse or timeout, add gpt-4o params

This commit is contained in:
Paul Gauthier 2024-12-18 15:56:38 -08:00 committed by Paul Gauthier (aider)
parent a915c60999
commit c36c06ab99
2 changed files with 12 additions and 5 deletions

View file

@ -771,7 +771,9 @@ MODEL_SETTINGS = [
editor_model_name="openrouter/openai/gpt-4o",
editor_edit_format="editor-diff",
use_repo_map=True,
streaming=False,
use_temperature=False,
extra_params=dict(reasoning_effort="high"),
),
ModelSettings(
"openrouter/qwen/qwen-2.5-coder-32b-instruct",

View file

@ -644,10 +644,12 @@ def run_test_real(
if results_fname.exists():
try:
res = json.loads(results_fname.read_text())
return res
if res.get("test_timeouts", 0) > 0:
print(f"{results_fname} test timeouts, redoing...")
else:
return res
except JSONDecodeError:
print(f"{results_fname} failed to parse, skipping")
return
print(f"{results_fname} failed to parse, redoing...")
# Read solution and test files from config
fnames = []
@ -800,8 +802,11 @@ def run_test_real(
try:
errors = run_unit_tests(original_dname, testdir, history_fname, test_files)
except subprocess.TimeoutExpired:
errors = "Tests timed out!"
timeouts += 1
try:
errors = run_unit_tests(original_dname, testdir, history_fname, test_files)
except subprocess.TimeoutExpired:
errors = "Tests timed out!"
timeouts += 1
if errors:
test_outcomes.append(False)