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