Skip to content

feat(agent): write run_stats.csv with the stats of each scenario - #713

Open
omkargaikwad23 wants to merge 7 commits into
mainfrom
feat/agent-run-stats
Open

omkargaikwad23 wants to merge 7 commits into
mainfrom
feat/agent-run-stats

Conversation

@omkargaikwad23

@omkargaikwad23 omkargaikwad23 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

With num_trials above 1, an agent run also writes run_stats.csv. The file has one row for each scenario.

  • A trial passes if its goal_completion score is at or above pass_threshold. The default is 100. An invalid value stops the job before the trials run.
  • Each row has the trial counts, pass rate, flakiness, confidence, Wilson interval, score mean and standard deviation, and a status.
  • The status is PASS if every trial was scored and passed, FAIL if every trial was scored and at least one failed, and ERROR if at least one trial was unscored.
  • Each row also has the min, median, and max of the numeric metrics, such as tokens and latency, and the pass rate of the other 0 to 100 scorers.
  • An unscored trial is not in these numbers.

Example rows, with some columns left out:

scenario_id num_trials passed_trials pass_rate flakiness confidence interval_low interval_high status
capitals 3 3 1.0 0.0 0.3439 0.4385 1.0 PASS
write_file 3 1 0.3333 0.8889 0.0037 0.0615 0.7923 FAIL

Nothing changes with one trial. Only the csv reporter writes the file. The suite stats in summary.csv and the BigQuery table are not in this PR.

Why

One result does not show if a scenario passes each time. With these stats, a team can tell a scenario that fails each time from a flaky scenario.

Testing

In all three runs, the values in run_stats.csv match a separate calculation from scores.csv.

The first paste also has these checks:

  • The new code on the scores.csv of two earlier runs. One has a scenario that passed 1 of 3 trials. One has a scenario with a 429 error in all trials.
  • With pass_threshold: 150, the job stops with exit code 1 before the first trial.
  • With num_trials: 1, the job writes no run_stats.csv.

Not run: Codex CLI, a job through the gRPC service (one unit test covers this path).

With num_trials above 1, an agent run writes one row of stats for each
scenario: pass rate, flakiness, confidence, Wilson interval, score mean
and standard deviation, and status. A trial passes if its goal_completion
score is at or above pass_threshold (default 100). Unscored trials are
not in the pass rate.
Comment thread evalbench/reporting/runstats.py Fixed
@omkargaikwad23

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