From b0fff27dd770df03e112034c2c123bc7017abbfc Mon Sep 17 00:00:00 2001 From: Muhamed Fazal PS Date: Wed, 15 Jul 2026 14:32:37 +0530 Subject: [PATCH] Fix #83: Add extension handling to TerminalReport.generate_to_file --- openagent_eval/reports/terminal.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openagent_eval/reports/terminal.py b/openagent_eval/reports/terminal.py index 9093030..131ff60 100644 --- a/openagent_eval/reports/terminal.py +++ b/openagent_eval/reports/terminal.py @@ -108,7 +108,12 @@ def generate_to_file(self, report: Any, output_path: Path | str) -> Path: Returns: Path to the written file. """ - path = self._ensure_output_dir(output_path) + path = Path(output_path) + if path.suffix == "": + path = path / "report.txt" + elif path.suffix.lower() != ".txt": + path = path.with_suffix(".txt") + path = self._ensure_output_dir(path) content = self.generate(report) path.write_text(content, encoding="utf-8") return path