Repository navigation
fix(terminal_bench_2_1): mask verifier and sandbox infra errors instead of scoring 0 - #5675
Conversation
…ad of scoring 0 The verifier scored reward 0 for any exception while uploading tests, running test.sh or downloading reward.txt, and the terminus-2 terminal raised a plain RuntimeError for tmux control failures, which fell into the scored "failed" branch. Verifier infrastructure errors are now reported as VERIFIER_ERROR with observe_failure, and terminal control failures raise SandboxLostError, so the agent reports an infrastructure error. A test.sh timeout, a broken /logs/verifier directory and an absent or invalid reward.txt still score 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test 3f59539 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD
The new classifier can exclude model-caused failures from evaluation and still count some sandbox failures as wrong answers. The inline findings describe the affected branches and preservation checks.
RISK — Supply the required real-rollout and before/after reward evidence. This changes a fixed benchmark’s scoring population and the agent’s failure handling, but the PR description reports only fake-sandbox tests and explicitly excludes a live-provider end-to-end run. The review rubric requires before/after reward-profiling evidence for benchmark-verifier changes, and AGENTS.md requires representative real model rollouts for behavior-changing agent work. Without those results, the provider-facing classification and its effect on reported scores remain unvalidated.
Add the evidence to the PR’s validation section after correcting the classifier: identify the tasks, model, provider and configurations, and report base/head mean reward, measured/masked counts, and failure-kind counts with artifact references. Inspect representative agent and verifier trajectories. Healthy passing and failing tasks should retain their grades; task-caused terminal/filesystem failures should remain verifiable or scored failures; genuine provider failures should be unscored. Explain the intended aggregate shift from removing infrastructure zeros, rather than treating any score increase as confirmation. This is a validation handoff, not an executed experiment.
I inspected all five changed files and traced the directly affected sandbox, agent-outcome, failure-reporting and metric contracts. I couldn't execute tests or live rollouts in this read-only review.
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.
…biguous timeouts and probe exits as inconclusive Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
On the real-rollout evidence: this PR has no live-provider run, as the description says. The classification is covered with fake sandboxes, including the cases above (task-caused upload and terminal failures stay scored, provider failures are masked). |
Signed-off-by: Adam Rajfer <[email protected]>
giuliolovisotto
left a comment
There was a problem hiding this comment.
Please complete the touched failure paths using the shared NgFailureEvent contract, rather than retaining custom sandbox-loss exceptions and using HTTP status as the outcome decision. The immediate issues are ordinary command exits being promoted to sandbox loss, provider events losing their identity/cause across the agent route, and caught verifier failures being recorded without their original cause. Preserve observed facts, let the owning boundary apply the configurable outcome policy, and persist the applied decision when returning a handled result.
Validation: the TB2.1 suite passed 54 tests with 13 fixture-dependent skips. A direct verify-method probe reproduced loss of the original provider event, including its ID and HTTP 503. An extracted terminal-method probe reproduced SandboxLostError from a normal exit 127. The Harbor-dependent terminal suite could not collect in the review environment. No live rollout or merged-main integration was run. Some of the custom agent handling predates this patch; migrating that connected path is part of the requested contract alignment.
…om exceptions The Terminus 2 sandbox adapter forwards a provider NgFailureEvent unchanged and reports a raised transport error or a structured sandbox error as a provider_unavailable event with its cause, so the id, kind, status and details survive the agent route. The route fails with an agent route failure whose cause is that event, and the boundary that owns the outcome applies its policy; no custom exception implies an HTTP status or a retry. A nonzero command exit stays an ordinary result and the terminal helpers raise plain RuntimeError again. The Terminal-Bench 2.1 verifier links its verifier_error event to the caught exception, so a provider event arriving at verify keeps its identity in the failure report. A typed provider failure while downloading the reward masks the sample without a probe, and the recorded reason no longer embeds raw exception text. Signed-off-by: Adam Rajfer <[email protected]>
|
I reworked this on the shared NgFailureEvent contract in 96f5126. The Terminus 2 adapter forwards provider events with their identity, a nonzero command exit stays an ordinary result, and the verifier event now carries the caught exception as its cause. The Terminus 2 and TB2.1 suites pass, including the harbor-dependent terminal tests that did not collect before. |
When the failure that stops verification is a typed provider event, the verify response and the verifier-stage event carry that event kind and status, with the event itself as cause. Only verifier-side failures remain verifier_error. Signed-off-by: Adam Rajfer <[email protected]>
giuliolovisotto
left a comment
There was a problem hiding this comment.
@AdamRajfer Rechecked c659e43. I resolved the ordinary-terminal-exit and verifier-cause threads: those fixes hold. Approval remains blocked by the typed-download shortcut and the outstanding policy application point described below.
CI also has a deterministic public-import failure: resources_servers/terminal_bench_2_1/tests/test_app.py imports FailureHeader from nemo_gym.core.failure_transport; it is exported from nemo_gym.core and should be imported there. Failed job: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42205997960/job/127853696288
Local TB2.1 validation: 118 passed, 13 fixture-dependent skips. The missing-reward probes used the actual verify method; the current-contract probe loads this PR's module against the newer shared failure schema. This is not a complete merged-main or live-provider run. Harbor-dependent tests were not available locally.
…licy An agent session reports a sandbox or model infrastructure failure as a failed response carrying the provider event, and the Environment Server selects retry or fail from its agent_outcome_policy by failure kind instead of from the HTTP status. The Terminal Bench 2.1 verifier applies an outcome_policy of its own (retry masks the sample, count_as_zero scores it) to a verification that could not produce a verdict. A failed reward download is a failed grade only when the sandbox confirms that reward.txt is absent, typed or not, so a provider 404 for a missing file is no longer masked. Import FailureHeader from nemo_gym.core. Signed-off-by: Adam Rajfer <[email protected]>
|
Pushed 3d999fa for the second round. CI: |
Signed-off-by: Adam Rajfer <[email protected]>
…verifier's applied decision An agent that reports a sandbox provider failure now forwards the specific provider kind, so the default agent outcome policy has to retry the transient ones the way the previous status-based handling did. Add provider_io_timeout, provider_status_unavailable, provider_command_outcome_unknown and provider_protocol_error next to provider_unavailable. This is an episode-level retry decision; it does not replay an uncertain command inside the provider, and a configured kind rule still overrides it. The Terminal-Bench 2.1 verifier now returns the policy action and attribution it applied (failure_outcome_action and failure_outcome_attribution), so a configured count_as_zero survives a saved row and recovery counts it as a legitimate zero instead of treating it as masked. Tests run the Environment Server's run_request for each retryable kind, with and without a configured rule and with different cause statuses, and keep the provider event as the cause. The verifier test saves the row from the real verify method and runs it through the recovery gate. Signed-off-by: Adam Rajfer <[email protected]>
…by default provider_request_failed, provider_internal_error and provider_pty_unavailable are environment faults that the earlier status-based handling retried, so the default agent outcome policy retries them too. provider_command_timeout stays unlisted because an agent command deadline can be the model's own. The policy remains configurable. The run_request and Terminus session tests cover the three kinds. Signed-off-by: Adam Rajfer <[email protected]>
giuliolovisotto
left a comment
There was a problem hiding this comment.
Re-reviewed e7be213 and the latest follow-up commits. The outstanding transient-provider retry and saved verifier-decision issues are addressed, including the saved-row recovery regression. Focused validation: 203 passed, 13 skipped. No live provider/model rollout was run during this re-review.
CI still has pending checks; this approval does not claim those have finished.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42630328561 |
Behaviour. Terminal-Bench 2.1 scored a reward of 0 for any exception in the verifier (uploading the tests, running
test.sh, downloadingreward.txt), so a lost sandbox counted as a wrong answer. terminus-2 turned provider failures into a custom sandbox-loss exception that implied an HTTP 503 and a retry.test.sh, a connection error during upload or download) are reported throughobserve_failure, keep the caught exception, including a providerNgFailureEvent, as the cause, and leave the row unscored (evaluation_completed: false). A typed provider failure keeps its provider kind; a verifier-side failure isverifier_error.outcome_policy) chooses between masking the sample (retry, the default) and an unmasked zero (count_as_zero). The applied action and attribution are returned asfailure_outcome_actionandfailure_outcome_attribution, so a saved row and recovery read the decision instead of inferring it.reward.txtdownload, typed or not, is a failed grade only when the sandbox answerstest -fwith exit 1. Any other probe result is inconclusive and the sample is masked.test.shresult witherror_type="timeout", a nonzeromkdirof the upload or/logs/verifierdirectory on a healthy sandbox, and an absent or invalidreward.txt.NgFailureEventunchanged and reports a raised transport error or a structured sandbox error asprovider_unavailablewith the original as cause. An ordinary nonzero command exit stays a command result. In an agent session the harness returns a failed response carrying the provider event and its kind; the Environment Server'sagent_outcome_policyselects retry or fail by kind, not by the HTTP status of the cause. Cancellation and the legacy/runpath still raise.provider_unavailable,provider_io_timeout,provider_status_unavailable,provider_command_outcome_unknown,provider_protocol_error,provider_request_failed,provider_internal_errorandprovider_pty_unavailable, as the earlier status-based handling did (provider_command_timeoutis not retried by default, since an agent command deadline can be the model's own). This is an episode-level retry; it does not replay an uncertain command inside the provider, and a configured kind rule overrides it.Validation. Covered by unit tests only; no live rollout was run.
resources_servers/terminal_bench_2_1/tests: 127 passed, 13 skipped (fixture-dependent). The tests cover masking and unmasked-zero outcomes for each failing verifier operation, the reward-download probe, the provider event and cause surviving the failure header, a configured outcome policy changing the outcome, and a saved row from the realverifymethod counted by the recovery gate.environment_servers/single_agent_turn/tests: 216 passed.run_requestis exercised for each retryable provider kind, with and without a configured kind rule and with different cause statuses, keeping the provider event as the cause.responses_api_agents/terminus_2_sandboxed_agent/tests: 168 passed with Harbor 0.22.0 installed separately; they do not collect without Harbor.tests/unit_tests/agents,tests/unit_tests/rollouts, the outcome-policy, shared-fault-class, masked-recovery and recovered-policy-gate orchestration tests (3289 passed, 2 skipped), andsingle_agent_turn_legacy(43 passed).Revert. Revert this PR.