From 41f12dd67134a9b1c87306f62a2277e329a5baeb Mon Sep 17 00:00:00 2001 From: Muhamed Fazal PS Date: Wed, 15 Jul 2026 14:33:32 +0530 Subject: [PATCH] Fix #86: Validate config key in ReportManager.reconstruct() --- openagent_eval/reports/manager.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openagent_eval/reports/manager.py b/openagent_eval/reports/manager.py index 3db3c42..bb47a6e 100644 --- a/openagent_eval/reports/manager.py +++ b/openagent_eval/reports/manager.py @@ -169,10 +169,18 @@ def reconstruct(data: dict[str, Any]) -> EvaluationReport: This is useful when loading a report and passing it to report generators that expect the full dataclass. + + Raises: + ValueError: If the ``config`` section is missing from the data. """ from openagent_eval.config.models import Config - config = Config(**data.get("config", {})) + config = data.get("config") + if not config: + raise ValueError( + "Cannot reconstruct EvaluationReport: 'config' section is missing from data" + ) + config = Config(**config) results = [ EvaluationResult(