Repository navigation
fix(terminal_bench_4): score a verifier that times out or leaves no reward as 0, as Terminal-Bench does - #5038
Conversation
…eward as 0, as Terminal-Bench does A verifier can run but time out, or leave no reward file, an empty one or one that cannot be parsed. Each was reported as an infrastructure error, so collection sent the task to the failure sidecar and the task left the pass-rate denominator (NVIDIA-NeMo#4986). Terminal-Bench's harness, Harbor, never retries these four outcomes and counts a trial without a reward as 0. Such a task now scores 0 and stays in the denominator. The response keeps evaluation_completed false, names the exception in failure_reason, and sets failure_kind verifier_error. The outcome is read from the verifier's own diagnostic, because an agent that exited on a timeout or a nonzero code is recorded first, as the trial's exception. A verifier that fails to start stays an infrastructure error. Fixes NVIDIA-NeMo#4986. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test f0f6910 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD — Three BLOCKERs can turn infrastructure failures into permanent, unmasked scored zeros.
Reviewed all three changed files and traced verifier diagnostics, agent-response serialization, collector routing, and aggregate masking. The intended four-outcome classification works for the supplied unit-test cases, but the new scoring branch also admits the infrastructure cases detailed inline.
Validation was static only; no tests or rollouts were executed. Suggested patches require author verification before adoption.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| if not completed: | ||
| failure = (result.get("exception_info") or {}).get("exception_type", "MissingOfficialReward") | ||
| failure_type = failure | ||
| verifier_failure = _scored_verifier_failure(session.diagnostics) |
There was a problem hiding this comment.
BLOCKER — Preserve independent agent infrastructure failures
Failure: A started agent can terminate with infrastructure_error after a model/provider failure and still be graded. If the verifier then raises any whitelisted exception, this branch suppresses the earlier AgentInfrastructureError and returns an unmasked zero without _ng_failure_class. The infrastructure check below is an elif, so it never runs. This silently lowers the benchmark score and makes collection consider the attempt permanently done. The reachable path is in agent finalization; the existing agent-outcome regression explicitly retains infrastructure classification for this termination reason.
Correction: In _verified_response, only apply the whitelist when there is no independent agent infrastructure termination. Replace this assignment with:
verifier_failure = (
_scored_verifier_failure(session.diagnostics)
if session.termination.reason != "infrastructure_error"
else None
)This retains the existing exception_info fallback and its infrastructure markers. Invariant: an inconclusive verifier must not erase an independently established agent infrastructure failure.
Preservation / acceptance: Proposed regression: supply termination infrastructure_error, result exception_info.exception_type='AgentInfrastructureError', and a verifier_execution diagnostic for each of the four exceptions. Expect _ng_failure_class='infrastructure_error', _ng_failure_type='AgentInfrastructureError', and non-null infrastructure_error. Retain scored-zero behavior for the same verifier exceptions after completed, timeout, nonzero_exit, or cancelled terminations. Completed official rewards must retain their existing agent-infrastructure classification; completed sandbox-resource-limit zeros must remain unmarked. These checks are proposed, not executed.
There was a problem hiding this comment.
Right, thanks. Fixed in ddec2a3 as you suggested: the scored verifier outcomes now apply only when the agent did not end on an infrastructure failure. Such a trial keeps AgentInfrastructureError and stays retryable, as on main. This also matches Harbor, which decides a retry from the trial's first exception, here the agent's.
A new test covers the four verifier outcomes after an agent infrastructure failure. The scored-zero test now runs after completed, timeout, nonzero_exit and cancelled terminations.
… verifier zeros Three paths could still turn an infrastructure failure into a scored 0: - An agent that ended on an infrastructure failure, followed by a verifier that timed out or left no reward. Harbor decides a retry from the trial's first exception, here the agent's, so the trial stays an infrastructure failure. - A provider call that timed out within the verifier's budget. Only that budget now makes a VerifierTimeoutError; the provider's TimeoutError propagates as raised. - A sandbox that reported no command outcome (error_type set) for the verifier's commands. The verifier now fails instead of reading the reward files as missing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test ddec2a3 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP — No material findings.
Completed a fresh light review of all five changed files, including lifecycle diagnostics, response serialization, collection routing, and aggregate masking.
The three prior BLOCKERs are resolved: agent infrastructure failures remain classified as infrastructure, and the verifier distinguishes nested provider timeouts and rejects command-outcome errors. Inspected regression assertions cover these repairs and preserve scored verifier zeros and official rewards after nonzero process exits.
Validation was static source and test inspection only; no tests or smoke rollouts were executed.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Validate known overrides at startup and effective task budgets before sandbox creation or policy execution. Report incompatible settings as a terminal configuration failure without changing either configured limit. Cover the seed, agent and verification response boundary. Signed-off-by: Adam Rajfer <[email protected]>
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40107460375 |
What and why
Terminal-Bench 4 verifier timeouts and missing, empty or malformed reward files were recorded as infrastructure failures, removing tasks from the pass-rate denominator. Harbor 0.22.0 excludes those four exceptions from retries and counts a trial without a reward as zero.
This change follows that benchmark-native behavior: those verifier outcomes remain measured zeros with
failure_kind: verifier_error,evaluation_completed: falseandmask_sample: false. An earlier agent infrastructure failure, verifier startup failure, provider timeout or sandbox result without a command outcome remains an infrastructure failure.Configuration preflight
environment.default_exec_timeout_smust cover the effective verifier budget. Known incompatible overrides are rejected at startup; a task-specific incompatibility is rejected before sandbox creation or policy execution and reported as a terminal configuration failure. The configured command limit and native verifier budget are preserved.This prevents a shorter command limit from making an interrupted verifier look like a benchmark-native missing-reward zero. Exit-code sign and elapsed transport time are not used to infer the cause.
Validation
Fixes #4986.
AI-assisted update prepared for Adam Rajfer.