Repository navigation
feat(agent): write run_stats.csv with the stats of each scenario - #713
Open
omkargaikwad23 wants to merge 7 commits into
Open
omkargaikwad23 wants to merge 7 commits into
omkargaikwad23 wants to merge 7 commits into
Conversation
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.
omkargaikwad23
requested review from
IsmailMehdi,
helloeve and
prernakakkar-google
as code owners
November 17, 2026 16:04
A named scorer now uses its own pass_threshold. A scorer config key with no score rows gets no pass rate column. Removed an unused variable.
Collaborator
Author
|
/gcbrun |
This was referenced Nov 18, 2026
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
With
num_trialsabove 1, an agent run also writesrun_stats.csv. The file has one row for each scenario.goal_completionscore is at or abovepass_threshold. The default is 100. An invalid value stops the job before the trials run.PASSif every trial was scored and passed,FAILif every trial was scored and at least one failed, andERRORif at least one trial was unscored.Example rows, with some columns left out:
scenario_idnum_trialspassed_trialspass_rateflakinessconfidenceinterval_lowinterval_highstatuscapitalsPASSwrite_fileFAILNothing changes with one trial. Only the
csvreporter writes the file. The suite stats insummary.csvand 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
num_trials: 3, 4 scenarios. Logs: https://paste.googleplex.com/6755399437121140 (Google-internal)num_trials: 3, 4 scenarios, withpass_threshold: 80. One scenario passed 2 of 3 trials and has statusFAIL. Logs: https://paste.googleplex.com/6755399437124988 (Google-internal)num_trials: 3, 4 scenarios. Logs: https://paste.googleplex.com/6755399437124992 (Google-internal)In all three runs, the values in
run_stats.csvmatch a separate calculation fromscores.csv.The first paste also has these checks:
scores.csvof two earlier runs. One has a scenario that passed 1 of 3 trials. One has a scenario with a 429 error in all trials.pass_threshold: 150, the job stops with exit code 1 before the first trial.num_trials: 1, the job writes norun_stats.csv.Not run: Codex CLI, a job through the gRPC service (one unit test covers this path).