Repository navigation
feat(verifiers_agent): emit the rollout evidence health checks read - #3403
Merged
Merged
Conversation
A run of any verifiers benchmark reported `0 healthy, 0 unhealthy, N unobserved`: 10 of the 13 rollout health checks had nothing to read, so an infra outage and a model scoring zero looked the same in the summary. Turns reach the checks only through a producer-supplied `ng_trajectory` (`rollout_collection.py:_build_trajectory_record`); `ng_agent_observations` never supplies them. This agent emitted neither, and with no turns `_canonical_model_call_references` finds no references, so the bound-call checks went unobserved as well. `verifiers` owns the call loop and hands back only a rollout summary, so the agent never sees a model response to build a `ModelCallRef` from the way `simple_agent` does. The client is the one seam it does own: every call passes through `get_native_response`, so recording response ids and accumulating usage there yields the same references without verifiers having to expose anything. The evidence rides on the response object rather than on `self`, since rollouts run concurrently. Emits one turn per recorded model response, each claiming exactly the call it came from -- the checks read `turns[*].model_calls`, so an invocation-level list does not bind. Turn answers are sliced per turn; handing every turn the whole rollout's items would leave `agent_turn_hollow` unable to fire. A rollout whose calls all failed records no ids and reports a `model_call_reference_unavailable` gap rather than an empty trajectory. Measured on a 2-task automationbench run against a remote endpoint, before and after: before: 2 checked, 0 healthy, 0 unhealthy, 2 unobserved (10 checks blind) after: 2 checked, 2 healthy, 0 unhealthy, 0 unobserved Rollouts also carry token totals now; `response.usage` was previously null for every verifiers rollout. Signed-off-by: Wojciech Prazuch <[email protected]>
yaoyu-33
reviewed
Sep 21, 2026
| turn_no=index, | ||
| timestamp=now, | ||
| answer=items, | ||
| step_count=sum(1 for item in items if item.get("type") == "function_call"), |
Contributor
There was a problem hiding this comment.
TrajectoryTurn.step_count is cumulative within an invocation, but this resets it each turn: the existing two-turn fixture emits [1, 0]. Could you accumulate the count across turns and update the test to expect [1, 1]?
TrajectoryTurn.step_count is documented as cumulative; the turn loop reset it each turn, so a two-turn rollout reported [1, 0] instead of [1, 1]. Signed-off-by: Wojciech Prazuch <[email protected]>
Signed-off-by: Wojciech Prazuch <[email protected]> # Conflicts: # responses_api_agents/verifiers_agent/app.py
yaoyu-33
approved these changes
Sep 30, 2026
Contributor
|
/ok to test b4ba052 |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/36846581267 |
balajinvda
pushed a commit
to balajinvda/Gym
that referenced
this pull request
Oct 2, 2026
… skipping (NVIDIA-NeMo#3427) A rollout whose model calls all failed reports `0 healthy, 0 unhealthy, N unobserved` and reward 0 — indistinguishable from a model that scored zero. The gate already knew: `rollout_health.py` computes `ended_on_error` for the digest and reports it as a statistic, while the verdict stays `unobserved`. | | before | after | |---|---|---| | invalid-key run | `0 healthy, 0 unhealthy, 2 unobserved` | `0 healthy, 2 unhealthy, 0 unobserved` | Two independent causes. **Failed calls cannot bind.** Every per-call check reads bound calls, and binding resolves a reference by `(model_ref, response_id)` or `model_call_id` — a failed call has none of them. Adds `rollout_ended_on_failed_model_call`, reading the captured calls directly. It shares `_ended_on_failed_call` with the existing `ended_on_error` statistic, so the two cannot disagree. Reading the capture rather than a reference also covers the 45 of 47 agents that publish no trajectory. Only the last call is judged. The capture records every HTTP attempt, so flagging any failed call would turn ordinary retries unhealthy. **`rollout_missing_agent_turns` was skipped when turns were missing.** `turns_unavailable` was appended whenever the turn list was empty, and the AGENT_TURNS gate then dropped the check. Now recorded only when no producer published a trajectory, so an agent that publishes one and reports no turns produces a finding; agents that publish nothing stay unobserved. ## Testing End-to-end `gym eval run`, 2 tasks, observability on: | run | agent | before | after | |---|---|---|---| | invalid key | stock | `0/0/2 unobserved` | `0/2 unhealthy/0` | | invalid key | publishes trajectory (NVIDIA-NeMo#3403) | `0/0/2 unobserved` | `0/2 unhealthy/0` | | passing | stock | `0/0/2 unobserved` | unchanged | | passing | publishes trajectory (NVIDIA-NeMo#3403) | `2 healthy/0/0` | unchanged | Also replayed over five stored rollouts from earlier real runs, two of which contain a genuine `error_category: exception` call mid-rollout followed by successful calls. Verdicts are byte-identical to `main` — the retry tolerance holds on real captured data, not just a fixture. 6 unit tests, each mutation-checked: the invariant was broken in the source and the test confirmed to fail. `pre-commit --all-files` clean. `tests/unit_tests/` has 13 pre-existing sandbox-provider failures, identical on unmodified `main`. ## Context Found while closing the agent-side half in NVIDIA-NeMo#3403. That PR makes `verifiers_agent` publish the evidence; this one lets the gate act on evidence it already had. They are independent — each is useful alone. Real impact: a 600-task run had 75 failed calls across 61 rollouts, 25 of which ended on error, all reported as ordinary zeros. --------- Signed-off-by: Wojciech Prazuch <[email protected]>
khazic
pushed a commit
to khazic/Gym-lao
that referenced
this pull request
Oct 9, 2026
…IDIA-NeMo#3951) ## What and why AutomationBench rollouts only carry aggregate counts (`objectives_passed`, `guardrails_violated`, ...). Finer breakdowns, such as Artificial Analysis's per-app views ("Objectives Completed Across Apps", "Violation Rate Across Apps"), can't be rebuilt from rollouts without re-simulating, even though the env computes every per-assertion verdict while scoring. This PR adds an opt-in way to keep those verdicts. - **`benchmarks/automationbench/automationbench_env`:** `assertion_results(state)` returns one record per assertion. Each record has `index`, `type`, `app` (the WorldState service the assertion inspects), `role` (`objective`, `guardrail` or `unscored`), `passed` and `initially_passed`. The records are computed once and cached on the verifiers state under `assertion_results`. `_counts` now derives from them, so each assertion is checked once instead of four times. `aa_headline` is unchanged. - **`responses_api_agents/verifiers_agent`:** a new `export_state_columns` option (default `[]`) adds verifiers State keys to `run_group(state_columns=...)` and returns them in `response.exported_state`. The field is omitted when empty, using the same `exclude_if` pattern NVIDIA-NeMo#3403 uses for `ng_trajectory`. It works for any verifiers env that stores JSON-serializable values on its state. - **`config.yaml` and README:** `config.yaml` documents the option (off by default), and the README gains a "Per-assertion results (optional)" section. To enable it: ```bash ++automationbench.responses_api_agents.verifiers_agent.export_state_columns='[assertion_results]' ``` --------- Signed-off-by: Daniele Molinari <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was previously deployed
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
A run of any
verifiers_agentbenchmark reports0 healthy, 0 unhealthy, N unobserved. 10 of the 13 rollout health checks have nothing to read, so an infra outage and a model genuinely scoring zero look identical in the run summary. This makes the agent emit the evidence those checks need.Measured on a 2-task
automationbenchrun against a remote endpoint:Rollout health:2 checked, 0 healthy, 0 unhealthy, 2 unobserved2 checked, 2 healthy, 0 unhealthy, 0 unobservedNewly evaluated:
model_call_failed,model_call_zero_completion_tokens,model_call_missing_token_counts,model_call_runaway_generation,agent_turn_hollow,rollout_missing_agent_turns,trajectory_capture_mismatch,task_no_successful_model_calls,rollout_token_count_mismatch,task_consistently_unhealthy.Why it needed a different approach than
simple_agentTurns reach the checks only through a producer-supplied
ng_trajectory(rollout_collection.py:_build_trajectory_record) —ng_agent_observationsnever supplies them. With no turns,_canonical_model_call_referencesfinds no references and the bound-call checks go unobserved too. So the agent has to produce aTrajectoryRecord, and only 2 of 47 agents currently do.simple_agentbuilds itsModelCallRefs frommodel_response.idbecause it issues the calls itself. Hereverifiersowns the call loop and hands back only a rollout summary, so the agent never sees a response. The client is the one seam it does own: every call passes throughget_native_response, so_ResponseIdRecordingClientrecords ids and accumulates usage there. No change is needed inverifiers.The evidence rides on the response object rather than on
self, because rollouts run concurrently.Details worth a look
turns[*].model_calls; an invocation-level list binds but leaves every per-call finding unattributable.agent_turn_hollowcould never fire.msg_emptyplaceholder is not counted as a turn._convert_trajectory_to_outputappends it whenever no token ids came back, which is every rollout served by a remote endpoint (vllm_model.yamlsetsreturn_token_id_information: false). Counting it would dress the one case worth catching — a call that produced nothing — as a turn that spoke.model_call_reference_unavailablegap rather than an empty trajectory.response.usagewas null for every verifiers rollout; it now carries the summed token totals.Testing
gym eval run --benchmark automationbench --limit 2against a remote endpoint, observability on, before and after — the table above. Per-turn output from the "after" run:6 unit tests in
tests/test_app.py. Each was mutation-checked: the corresponding invariant was broken inapp.pyand the test confirmed to fail. One of them was vacuous on the first pass (it passed with the invariant removed) and was rewritten against the case that actually distinguishes.pre-commit run --all-filesclean;tests/unit_tests/test_rollout_{observability,health,collection}.py284 passed.Known gap this does not close
A negative control — same run with an invalid API key, so all 6 model calls return
403 auth— still reports2 checked, 0 healthy, 0 unhealthy, 2 unobservedand reward 0.0. The capture holds the evidence (status_code: 403,error_category: auth), and the agent correctly reports themodel_call_reference_unavailablegap, but the gate cannot use either:model_call_failedreadsOWNED_MODEL_CALLS, and a failed call has noresponse_id, so it can never bind. Catching it needs a check that reads the capture rows directly rather than through bindings.rollout_missing_agent_turnsreadsAGENT_TURNS, androllout_health.py:159marks anyAGENT_TURNScheck unobserved when no turns were observed — so the check meant to catch "this rollout has no turns" is skipped exactly when there are none.Both are in the health gate, not in this agent, so they are out of scope here. Flagging for whoever owns
rollout_health— happy to open a separate PR if that is wanted. This matters in practice: a 600-task run had 75 failed calls across 61 rollouts, 25 of which ended on error, and every one was reported as an ordinary zero.Related
/ng-rollout/<id>capture prefix in this agent (capture files 0 → 1 per rollout).This PR is the next layer: capture now happens, and the trajectory that binds to it exists.