This commit is contained in:
gstreet-ops 2026-08-15 13:14:01 +08:00 committed by GitHub
commit 9840d6bf3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 8 deletions

View File

@ -316,7 +316,7 @@ def main():
html_output = generate_html(data, skill_name=args.skill_name)
if args.output:
Path(args.output).write_text(html_output)
Path(args.output).write_text(html_output, encoding="utf-8")
print(f"Report written to {args.output}", file=sys.stderr)
else:
print(html_output)

View File

@ -9,6 +9,7 @@ import argparse
import json
import os
import select
import shutil
import subprocess
import sys
import time
@ -65,10 +66,10 @@ def run_single_query(
f"# {skill_name}\n\n"
f"This skill handles: {skill_description}\n"
)
command_file.write_text(command_content)
command_file.write_text(command_content, encoding="utf-8")
cmd = [
"claude",
shutil.which("claude") or "claude.cmd",
"-p", query,
"--output-format", "stream-json",
"--verbose",

View File

@ -148,7 +148,7 @@ def run_loop(
"test_size": len(test_set),
"history": history,
}
live_report_path.write_text(generate_html(partial_output, auto_refresh=True, skill_name=name))
live_report_path.write_text(generate_html(partial_output, auto_refresh=True, skill_name=name), encoding="utf-8")
if verbose:
def print_eval_stats(label, results, elapsed):
@ -275,7 +275,7 @@ def main():
else:
live_report_path = Path(args.report)
# Open the report immediately so the user can watch
live_report_path.write_text("<html><body><h1>Starting optimization loop...</h1><meta http-equiv='refresh' content='5'></body></html>")
live_report_path.write_text("<html><body><h1>Starting optimization loop...</h1><meta http-equiv='refresh' content='5'></body></html>", encoding="utf-8")
webbrowser.open(str(live_report_path))
else:
live_report_path = None
@ -310,15 +310,15 @@ def main():
json_output = json.dumps(output, indent=2)
print(json_output)
if results_dir:
(results_dir / "results.json").write_text(json_output)
(results_dir / "results.json").write_text(json_output, encoding="utf-8")
# Write final HTML report (without auto-refresh)
if live_report_path:
live_report_path.write_text(generate_html(output, auto_refresh=False, skill_name=name))
live_report_path.write_text(generate_html(output, auto_refresh=False, skill_name=name), encoding="utf-8")
print(f"\nReport: {live_report_path}", file=sys.stderr)
if results_dir and live_report_path:
(results_dir / "report.html").write_text(generate_html(output, auto_refresh=False, skill_name=name))
(results_dir / "report.html").write_text(generate_html(output, auto_refresh=False, skill_name=name), encoding="utf-8")
if results_dir:
print(f"Results saved to: {results_dir}", file=sys.stderr)