Repository navigation
fix(agents): mask harness infrastructure failures in pi_sandboxed, verifiers and osworld - #5679
Conversation
…rifiers and osworld - pi_sandboxed_agent raises a typed agent_route_failed failure when sandbox.exec throws, returns an execution error or the -1 sentinel; a timeout or exit code 124 still reaches the verifier, as in opencode_sandboxed_agent. - verifiers_agent masks rows whose rollout ended on an http_5xx, http_429, connection, infra or timeout failure instead of scoring them as model zeros; a 400, a tool error or an empty response is still scored. - osworld /verify records the masked evaluation failure as a verifier_error event tied to the verifier invocation, next to the masked row it already returned. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test 3614c2f |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD
The inline findings cover a retained Pi scoring defect (BLOCKER) and an introduced OSWorld error-handler regression (RISK).
RISK — Required real-rollout evidence is missing
The supplied validation lists unit cases and Ruff, but no representative model rollout or justified N/A. These changes alter which agent outcomes count toward quality scores. The protected AGENTS.md quality bar requires real smoke rollouts for behavior-changing agent work; mocked outcomes alone don't establish that the provider and harness error formats reach the intended branches.
Could you add representative Pi and verifiers-agent rollout evidence to the PR description? Include the command, resolved config, model, task subset, artifact links, and scored/masked/failed counts. For a fixed evaluation pairing, provide before/after reward and coverage numbers with the same tasks and settings. Healthy tasks should retain their rewards; Pi's returned command deadlines and ordinary process exits should retain their configured grading behavior; verifiers-agent's ordinary 400, tool, and empty-response cases should remain scored. Identify any injected infrastructure failures and confirm that they don't become model zeros. Label cases covered only by unit tests accordingly. This is a validation gap, not evidence that a live run failed.
I inspected all six changed files and traced the affected failure, verification, cleanup, and aggregation contracts. I couldn't execute tests or inspect the external verifiers implementation. The OSWorld child report wasn't delivered, so I completed that inspection directly.
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.
…nd the OSWorld failure reason Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
On the real-rollout evidence: no live Pi or verifiers-agent rollout was run for this PR. The classification is covered by unit tests with injected provider failures, including the raised-timeout case above. |
giuliolovisotto
left a comment
There was a problem hiding this comment.
Please complete the NgFailureEvent and outcome-policy integration in these touched paths. Verifiers currently changes scoring from diagnostic string candidates without producing canonical events; Pi preserves already typed causes but still lacks normalized sandbox evidence for untyped failures/results and a policy application point; OSWorld correctly links its cause but copies raw exception text into the new event.
Keep classification separate from action: a generic timeout or HTTP 429 does not by itself justify either a zero or exclusion. Use observed evidence, stage and configured policy, then preserve the applied result for downstream readers. This does not require bundling every provider migration. Coordinate completion-status changes with #5670/#5676 rather than introducing a competing completion contract.
Validation: Pi and OSWorld suites passed 61 tests. Direct probes confirmed that both preserve an already typed provider cause; OSWorld also copies a synthetic raw-error marker into the event. A fresh-main recovery helper probe showed the new verifiers agent_route_failed masked row is not eligible for infrastructure retry or reverification. The verifiers-dependent suite could not collect in the review environment. No live rollout or merged-main integration was run.
…shared outcome policy verifiers_agent: record a failed policy-model call from the SDK as a model-boundary failure event (HTTP status or transport, stage agent, SDK type only), and apply the agent-stage policy to the rollout that ended on it. The row keeps the event, the applied action and attribution, and marks a rollout with no assistant turn as having no generation, so a rerun can replace it. The string-derived mask on diagnostic kind candidates is gone. pi_sandboxed_agent: normalize a raised or returned provider failure of the agent command into a sandbox event with typed details, link it as the cause of the agent route failure, and select the outcome through an agent-stage policy instead of an unconditional raise. A raised timeout is a provider request failure, not a command deadline; a returned deadline is still graded. osworld: the verifier-error event uses a fixed reason and keeps the exception as its cause with selected diagnostics, without copying the evaluator text into the reason or the event. Signed-off-by: Adam Rajfer <[email protected]>
|
Pushed 01aa73d, which also merges current main for the new failure contract. verifiers_agent, pi_sandboxed_agent and osworld now report typed events and take the outcome from the shared agent-stage policy; details are in the inline replies. No live rollout was run, and the completion status is unchanged. |
giuliolovisotto
left a comment
There was a problem hiding this comment.
@AdamRajfer Rechecked 01aa73d. I resolved the OSWorld diagnostic-text thread; that fix holds. The typed event construction is improved, but the saved retry and counted-zero decisions still have execution gaps, and Pi's new normalization copies raw exception text. Reproductions and requested changes are inline.
CI's core failure is deterministic: use exported package imports for bounded_text (nemo_gym.utils), PROVIDER_IO_TIMEOUT (nemo_gym.core), and is_retryable_dependency_status (nemo_gym.server_runtime). Failed job: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42207043077/job/127856668945
Local Pi/OSWorld validation: 79 tests passed; the separate runtime-import test failed because desktop_env is not installed locally. The verifiers-dependent suite was unavailable locally. Focused probes exercised the actual policy/recovery helpers, Pi run path, and exception-normalization helper. No live rollout or complete merged-main integration was run.
Signed-off-by: Adam Rajfer <[email protected]>
…es under a partial policy override When the agent-stage policy selects count_as_zero, the verifiers agent now returns reward 0.0 instead of the rubric's score for the errored rollout, so the saved row is a counted zero. A partial outcome_policy override is now merged over the verifiers agent's own defaults instead of the shared ones, so untouched status rules (429 retry, 400 count_as_zero) survive. Signed-off-by: Adam Rajfer <[email protected]>
giuliolovisotto
left a comment
There was a problem hiding this comment.
Re-reviewed c0ff0a4. The outstanding positive-reward/count_as_zero and partial-policy-override issues are addressed. Validation: 36 shared policy tests passed, plus focused execution of the actual config validator and scoring function. The full verifiers SDK suite and a live rollout were not run locally during this re-review; current CI is green.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42630325699 |
Only the test imports conflicted; both sides' imports are kept. Note for review: main's #5679 now masks a verifiers rollout that ended on an http_5xx, 429, connection, infra or timeout failure and routes it through the agent-stage outcome policy. This branch raises on the same class of failure first, so with fail_rollout_on_model_server_error at its default the new policy path never runs for a dead policy server. Which of the two should win is a review decision. Signed-off-by: Wojciech Prazuch <[email protected]>
…swer main (#5679) already records a policy-call failure in verifiers_agent as a typed, masked model_transport_error/model_request_error row that the outcome policy acts on. The raise replaced that with an untyped agent_run_error, so it and its flag are removed. The connection retry window now closes when the server answers, so it bounds only an unbroken run of connection failures. A reachable server that answers 5xx after a reconnect is no longer reported as the earlier connection error, and the status-wait clip that relied on a still-open window is removed. Signed-off-by: Wojciech Prazuch <[email protected]>
…l server (NVIDIA-NeMo#5181) * fix: fail rollouts whose policy server died instead of scoring them Bound connection retries to a dead model server by a wall-clock window, cap status-retry and generic-error backoff at that window, and make verifiers_agent /run return 500 when the policy server failed the rollout. Signed-off-by: Wojciech Prazuch <[email protected]> * fix: drop the verifiers_agent raise; close the retry window on any answer main (NVIDIA-NeMo#5679) already records a policy-call failure in verifiers_agent as a typed, masked model_transport_error/model_request_error row that the outcome policy acts on. The raise replaced that with an untyped agent_run_error, so it and its flag are removed. The connection retry window now closes when the server answers, so it bounds only an unbroken run of connection failures. A reachable server that answers 5xx after a reconnect is no longer reported as the earlier connection error, and the status-wait clip that relied on a still-open window is removed. Signed-off-by: Wojciech Prazuch <[email protected]> --------- Signed-off-by: Wojciech Prazuch <[email protected]>
What does this PR do?
Harness infrastructure failures in pi_sandboxed, verifiers and osworld are typed events instead of scores or string-derived masks. Classification stays separate from the outcome: the event records what happened, the boundary's outcome policy decides.
provider_io_timeout, another raised exceptionprovider_request_failed, an unclassifiable returned resultprovider_command_outcome_unknown. An already typed sandbox exception is chained as it is. The agent route raises from that event through an agent-stage outcome policy (default fail,count_as_zeroconfigurable). A returned timeout or exit 124 is still graded. A provider timeout on the second exec never reaches grading any more.model_request_errorwith its status ormodel_transport_errorwithout a reply; the event records stage and SDK type, not text. The agent-stage policy decides the row (408, 425, 429 and 5xx retry; 400, 413 and 422 count as zero; configurable), and the row keeps the action, the attribution and the event, so a first-turn 503 with no answer ends masked with action retry and the rerun path can act on it. The string-based mask onkind_candidateis gone. A rollout with no assistant turn is marked as having no generation, so recovery does not take the placeholder for a saved answer.Validation
Covered by unit tests only; no live rollout was run, so there are no before/after reward or coverage numbers and none are claimed here. The tests exercise mocked provider and SDK outcomes, so they show that the error shapes handled in the code reach the intended branches, not that a real provider or harness produces those shapes.
test_import_runtime, which needs thedesktop_envmodule that is not installed in the test environment.TestPolicyClientx2 andtest_recording_client_records_every_response_id_and_sums_usage), which was built from the pinned verifiers commit but not from the lock file.masked_infrastructure_kindfrom the saved row alone; a 400 with a positive rubric reward is a counted zero with reward 0.0; ordinary tool, empty-response and 400-in-text errors stay scored; a partial policy override keeps the untouched default rules; pi second-execTimeoutErroris a typed provider event and is never verified; a returned timeout or exit 124 is still graded; a selectedcount_as_zeroin pi does not call/verify, including with a masked or failing verifier; an osworld long error does not reach the row or report.Not covered
No live rollout. Infrastructure errors that appear only in the rollout error text (for example
SandboxError) are scored as before, since there is no SDK evidence for them. The-1exit sentinel still comes from the provider layer and is normalized inside pi. A masked 429, 408 or 425 row keeps its attribution and is rerun by recovery through its recorded retry action.