Repository navigation
fix(harness_agent): mask rollouts the sandbox provider reports as failed - #5354
Conversation
A task sandbox that dies mid-episode (OpenSandbox SANDBOX::ENDED, e.g. its container OOM-killed with exit 137), one that cannot be created, or a transport failure to it used to fail /run with HTTP 500 and abort the whole collection. Those rollouts measure the infrastructure, not the policy: they now come back masked (mask_sample=true, evaluation_completed=false) with failure_kind provider_oom_killed or provider_unavailable, and the sandbox is closed. Other errors still fail the run. A runner killed by a signal well before rollout_timeout (a pod evicted or recycled under load) is reported as RunnerTerminatedError and masked the same way; at the deadline it is still the agent running out of time. Signed-off-by: Khushi Bhardwaj <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Resolves the import conflicts with the config and core moves (#5189, #5203): the failure kinds now come from nemo_gym.core and SandboxCreateError from nemo_gym.sandbox, like the rest of the agent's imports. Signed-off-by: Khushi Bhardwaj <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…masks Timeouts and dropped connections count wherever they happen during the episode, including a call to the resources server, not only to the sandbox. Signed-off-by: Khushi Bhardwaj <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD — 2 BLOCKERs, 2 RISKs, and 1 NOTE.
The new masking paths can discard agent-caused failures, while some confirmed runtime failures still escape masking. Findings below include targeted corrections and proposed regression checks.
Completed inspection of both changed files and their affected provider, runner, lifecycle, response, and aggregation contracts. Considered the rollout evidence supplied in the PR. This review was static; no tests 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.
A runner killed by a signal before its deadline, or a runner log quoting SANDBOX::ENDED, does not show that the runtime failed: the agent's own commands can send the signal or print the text. Neither masks a rollout any more; RunnerTerminatedError and the text checks are gone. Gym's SandboxBackendUnreachableError (OpenSandbox backend loss, including its "Sandbox was OOM-killed" report) now does, alongside the SDK's exceptions, SandboxCreateError, and timeouts or dropped connections. Signed-off-by: Khushi Bhardwaj <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Khushi Bhardwaj <[email protected]>
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP — prior findings resolved; no eligible regressions found.
Verified all five findings from review 5715938828 against the current source:
- The classifier no longer masks ordinary runner failures based on log text or exit 137. It now recognizes Gym’s typed backend-loss exception and its OOM message.
- The runner-failure branch no longer promotes signals using elapsed time. Removing that exception path also eliminates the reported timing and diagnostic-classification failures.
- The regression tests retain SDK OOM/eviction masking, assert typed backend-OOM masking, and distinguish ordinary runner failures.
Completed follow-up inspection of both changed files and directly affected provider, import, cleanup, and response contracts, compared with the previous reviewed head. No introduced regression exceeding the historical moderate-impact ceiling was established. This was a scoped follow-up, not a fresh whole-PR review. Static inspection only; no tests were executed.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41153737197 |
What
harness_agentnow masks rollouts whose sandbox the provider reports as failed, instead of failing/runwith HTTP 500:SandboxApiExceptionwithSANDBOX::ENDEDwhen the container was OOM-killed or evicted), Gym'sSandboxCreateErrororSandboxBackendUnreachableError, or aTimeoutError/ConnectionError(to the sandbox or to the resources server) returns a masked row:mask_sample=true,evaluation_completed=false,reward=0,failure_kindprovider_oom_killedwhen the provider's message names an OOM kill (exited with code 137,OOMKilled,Sandbox was OOM-killed), elseprovider_unavailable. The sandbox is closed first./runas before. Runner output never decides it, and a runner that exits on a signal or with 137 stays a runner failure, since the agent's own commands can cause either.Why
No issue. Running SWE Atlas QA (OpenCode, 124 x 3, OpenSandbox) for a series of RL checkpoints, single dead sandboxes failed
/runwith HTTP 500, which aborted the collection or, withroute_failures_to_sidecar, scored the rollout as a policy failure (zero) although the policy never finished.Validation
pytest responses_api_agents/harness_agent/testson this branch, after merging main: 56 passed. The classifier test covers SDK 410s (OOM and eviction), backend loss (502 and OOM), creation failures, timeouts, and runner failures that must not mask (a log quotingSANDBOX::ENDED, exits 1, 137 and -1).run()tests cover a masked SDK 410, a masked backend OOM, and a propagated agent crash; aresponses()test covers a signal-killed runner staying a runner failure.pre-commit run --files <changed files>: passed.Rollout evidence
An earlier version of this change ran on the #4777 head for SWE Atlas QA evals of nine checkpoints (372 rollouts each); 2-5 rollouts per run ended in
SandboxApiException: ... HTTP 410 SANDBOX::ENDED, were masked, and every collection completed. That version also masked runners killed by a signal well before their deadline; review showed the agent itself can send that signal, so this PR no longer does.Compatibility
Rollouts that used to fail the run on a provider-reported sandbox failure now return masked rows; consumers should drop
mask_samplerows (the Atlas resources server already masks its own verification failures, #5105).Proposed labels:
bug,area:agent.🤖 Generated with Claude Code