Skip to content

fix(reporting): isolate reporting errors and temp-file cleanup in EvalService - #753

Open
graceqi-g wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
graceqi-g:fix/eval-service-reporting-isolation
Open

graceqi-g wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
graceqi-g:fix/eval-service-reporting-isolation

Conversation

@graceqi-g

Copy link
Copy Markdown
Collaborator

Summary

Split out from #729 per review feedback so EvalService reporter isolation can land independently of the BigQuery streaming change.

  • Per-reporter isolation (_build_reporters, _store_reports): Offloads reporter initialization into _process_results() on the worker thread pool and isolates both initialization and write (store / store_run_stats) errors per reporter. A failing reporter (e.g., BigQuery permission or quota error) no longer blocks healthy reporters (CSV, GCS artifacts) from writing their outputs.
  • No silent reporting failures:
    • When Eval() is called without summary_in_response (the default, where the RPC returns only job_id), _process_results(..., fail_on_reporting_errors=True) raises RuntimeError if any configured reporter fails — matching evalbench.py CLI behavior — after running all remaining reporters and cleaning up temp files.
    • Callers that receive summary (Eval with summary_in_response=True, Interact, AgentInteract) retain their completed evaluation scores and receive an explicit summary["reporting_errors"] list.
  • Guaranteed /tmp cleanup: Wraps JSON temp-file reads in try/finally with unlink(missing_ok=True) so Kubernetes emptyDir /tmp files are always cleaned up, including on EmptyEvalResultError or reporter failure.
  • PR feat(agent): write run_stats.csv with the stats of each scenario #713 (run_stats.csv) compatibility: Preserves expected_trials forwarding and invokes reporter.store_run_stats(run_stats_df) inside _store_reports()'s per-reporter try/except.

Verification

  • PYTHONPATH="$PWD/evalbench:$PWD" SKIP_CLOUD_TESTS=true pytest evalbench/test/eval_service_reporting_test.py evalbench/test/run_stats_test.py evalbench/test/evalbench_test.py evalbench/test/agent_num_trials_test.py -vv (100 passed)
  • pycodestyle evalbench/eval_service.py evalbench/test/eval_service_reporting_test.py --config=.pycodestyle (0 errors)

Related: #729 (BigQuery streaming inserts)

@graceqi-g
graceqi-g force-pushed the fix/eval-service-reporting-isolation branch from bcc97cd to 74f91eb Compare December 2, 2026 18:44
@graceqi-g

Copy link
Copy Markdown
Collaborator Author

/gcbrun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant