Skip to content

feat(verifiers_agent): emit the rollout evidence health checks read - #3403

Merged
wprazuch merged 5 commits into
mainfrom
wprazuch/verifiers-agent-observations
Oct 1, 2026
Merged

wprazuch merged 5 commits into
mainfrom
wprazuch/verifiers-agent-observations

Conversation

@wprazuch

Copy link
Copy Markdown
Contributor

What

A run of any verifiers_agent benchmark reports 0 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 automationbench run against a remote endpoint:

before after
Rollout health: 2 checked, 0 healthy, 0 unhealthy, 2 unobserved 2 checked, 2 healthy, 0 unhealthy, 0 unobserved
checks with no input 10 0

Newly 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_agent

Turns reach the checks only through a producer-supplied ng_trajectory (rollout_collection.py:_build_trajectory_record) — ng_agent_observations never supplies them. With no turns, _canonical_model_call_references finds no references and the bound-call checks go unobserved too. So the agent has to produce a TrajectoryRecord, and only 2 of 47 agents currently do.

simple_agent builds its ModelCallRefs from model_response.id because it issues the calls itself. Here verifiers owns 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 through get_native_response, so _ResponseIdRecordingClient records ids and accumulates usage there. No change is needed in verifiers.

The evidence rides on the response object rather than on self, because rollouts run concurrently.

Details worth a look

  • One turn per recorded response, each claiming only its own call. The checks read turns[*].model_calls; an invocation-level list binds but leaves every per-call finding unattributable.
  • Turn answers are sliced per turn. Handing every turn the whole rollout's items makes each turn look non-hollow as long as any one turn spoke, so agent_turn_hollow could never fire.
  • The msg_empty placeholder is not counted as a turn. _convert_trajectory_to_output appends it whenever no token ids came back, which is every rollout served by a remote endpoint (vllm_model.yaml sets return_token_id_information: false). Counting it would dress the one case worth catching — a call that produced nothing — as a turn that spoke.
  • A rollout whose calls all failed records no ids and reports a model_call_reference_unavailable gap rather than an empty trajectory.
  • response.usage was null for every verifiers rollout; it now carries the summed token totals.

Testing

gym eval run --benchmark automationbench --limit 2 against a remote endpoint, observability on, before and after — the table above. Per-turn output from the "after" run:

turn 1 answer: ['message', 'function_call'] step_count: 1 calls: ['chatcmpl-80ee9f79edc7954a']
turn 2 answer: ['message', 'function_call'] step_count: 1 calls: ['chatcmpl-bfa942bd8fe3aa2e']
verdict: healthy  unobserved: []  findings: []

6 unit tests in tests/test_app.py. Each was mutation-checked: the corresponding invariant was broken in app.py and 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-files clean; tests/unit_tests/test_rollout_{observability,health,collection}.py 284 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 reports 2 checked, 0 healthy, 0 unhealthy, 2 unobserved and reward 0.0. The capture holds the evidence (status_code: 403, error_category: auth), and the agent correctly reports the model_call_reference_unavailable gap, but the gate cannot use either:

  • model_call_failed reads OWNED_MODEL_CALLS, and a failed call has no response_id, so it can never bind. Catching it needs a check that reads the capture rows directly rather than through bindings.
  • rollout_missing_agent_turns reads AGENT_TURNS, and rollout_health.py:159 marks any AGENT_TURNS check 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

This PR is the next layer: capture now happens, and the trajectory that binds to it exists.

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]>
@copy-pr-bot

copy-pr-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33 yaoyu-33 added area:agent Agent harnesses and Responses API agent behavior complexity:low Localized change in one scope with a small, straightforward review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Sep 15, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Sep 16, 2026
turn_no=index,
timestamp=now,
answer=items,
step_count=sum(1 for item in items if item.get("type") == "function_call"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]?

@wprazuch wprazuch Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yaoyu-33 Fixed, could you re-check?

@yaoyu-33 yaoyu-33 added waiting-on-customer Waiting on the original author to respond and removed needs-review PR is ready for code review and waiting on a reviewer labels Sep 21, 2026
@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Sep 21, 2026
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 yaoyu-33 added ready-to-merge PR is approved, current, and waiting for final CI or merge and removed waiting-on-customer Waiting on the original author to respond labels Sep 30, 2026
@yaoyu-33

Copy link
Copy Markdown
Contributor

/ok to test b4ba052

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/36846581267

Merged via the queue into main with commit fd1cc02 Oct 1, 2026
45 checks passed
@wprazuch
wprazuch deleted the wprazuch/verifiers-agent-observations branch October 1, 2026 10:12
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

1 inactive deployment
public — b4ba0529 Deployed Sep 30, 2026 by copy-pr-bot[bot] via release / finalize / notify #4053
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior complexity:low Localized change in one scope with a small, straightforward review surface feature New capabilities, enhancements, or enablement work ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants