Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(benchmark): Fix `TestResult.fail_reason` assignment condition

Reinier van der Leer63e6014b27e9
diff --git a/benchmark/agbenchmark/reports/reports.py b/benchmark/agbenchmark/reports/reports.py
index 3eb0c0011f..60accd5864 100644
--- a/benchmark/agbenchmark/reports/reports.py
+++ b/benchmark/agbenchmark/reports/reports.py
@@ -90,7 +90,7 @@ def add_test_result_to_report(
TestResult(
success=call.excinfo is None,
run_time=f"{str(round(call.duration, 3))} seconds",
- fail_reason=str(call.excinfo.value) if call.excinfo else None,
+ fail_reason=None if call.excinfo is None else str(call.excinfo.value),
reached_cutoff=user_properties.get("timed_out", False),
n_steps=user_properties.get("n_steps"),
cost=user_properties.get("agent_task_cost"),