Repository navigation
feat(sandbox): typed sandbox failures and one agent-OOM policy for sandboxed benchmarks - #5504
Closed
AdamRajfer wants to merge 21 commits into
Closed
AdamRajfer wants to merge 21 commits into
AdamRajfer wants to merge 21 commits into
Conversation
|
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. |
This was referenced Nov 3, 2026
An ended sandbox was recognized by several text matchers, each reading a different part of the provider's message, and the failure events said nothing typed about it. nemo_gym.sandbox.failure_details reads OpenSandbox's ended-sandbox report (and Gym's own notice after a backend loss) in one place. The failure event carries SandboxFailureDetails as the schema defines them: the sandbox and execution ids, the provider and the provider's reason code as reported (OOMKilled, Evicted, Error), short enough that the whole event stays inside one failure-report header; no exit status is synthesized. The report also names the container that ended and whether an eviction was for storage; EndedSandbox keeps those readings beside the details for the caller that decides the kind. The kind follows the reason: provider_oom_killed exactly for OOMKilled. The phase is the event's stage. The coding agent, the harness agent and the Harbor agent observe that sandbox failure beside the failure they already report, so their replies, kinds and retries do not change. The harness agent's OOM kind now follows the typed reason; its text markers decide only where no report of an ended sandbox exists. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ommand is a final zero A provider-confirmed memory kill of the agent's sandbox while the agent's command ran was retried as infrastructure on one benchmark and masked on another. A retry resamples a model that exhausted the benchmark's memory limit, so the same event moved scores differently from one benchmark to the next; an upstream harness scores such a trial 0 and keeps it in the denominator. rollout_recovery.agent_phase_oom reads a rollout's failure events: a sandbox failure of kind provider_oom_killed (the provider reported OOMKilled) at stage agent. Collection marks such a failed rollout terminal and counted as zero, both when the agent's request raised and when it returned a failure-class result, so it is a final zero in the denominator and is never retried. A kill during setup or verification, any other provider reason (an eviction, an Error ending) and an exit status without a provider report stay retryable infrastructure, as before. Known limitation: the event does not yet say which container of the sandbox ended, so a helper container killed for memory during the agent's command also counts; this tightens when the event names the container. A masked result row (the harness agent) is not covered yet. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
AdamRajfer
force-pushed
the
arajfer/sandbox-failures
branch
from
November 3, 2026 17:01
7c5af09 to
649caa1
Compare
A memory kill of a sandbox's helper container (a sidecar or an init container) is not the agent's own, yet the typed sandbox failure called every provider-reported memory kill provider_oom_killed, so a helper container's kill during the agent's command became a final zero. The failure details now carry the container name as the provider reported it. The event kind is provider_oom_killed only when the provider reported a memory kill of the agent's own container, or named no container (Gym's own notice after losing the exec backend); a sidecar or init container's memory kill is provider_unavailable and is retried like any other infrastructure failure. The harness agent's failure kind follows the same reading. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A rollout whose agent's own sandbox was killed for memory during the agent's command is made a terminal counted zero, but recovery did not own such a row (its cause is a sandbox failure, not a model request), so the run stayed incomplete, and the health gate classed every provider kind as a server fault, so a few such kills could fail the 2% evaluation-health limit. Recovery now reads a counted terminal row whose failure events hold an agent-stage memory kill as the model's final result. The gate counts it under the derived class agent_sandbox_oom_killed, a model fault that keeps its sandbox cause in the trial failure rates and ignores the HTTP status of the failed reply. provider_oom_killed itself stays evaluation-side: a setup or verification kill, and a row without the final-zero markers, are unchanged. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The sandbox-killed-for-memory note now says what the stack does: an agent-stage kill of the agent's own container is a final zero, kept in the denominator, never retried and counted as a model fault by the health gate, for the Harbor general and sandboxed opencode agents. A helper container's kill, a setup or verification kill, other provider endings and an exit status without a provider report stay retried infrastructure. The fault class list names the new gate-derived kind. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
AdamRajfer
changed the base branch from
arajfer/stack-top
to
yuhez/2135-judge-recovery
November 3, 2026 19:44
…dbox-failures Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Contributor
Author
|
/ok to test ec697ac |
…dbox-failures Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Contributor
Author
|
/ok to test 4674673 |
… modules The agent-phase OOM policy tests imported NG_FAILURE_CLASS_KEY and NG_TERMINAL_KEY through package facades. The facade test requires the library's own tests to import each name from the module that defines it. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
/ok to test 37d763d |
…dbox-failures Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Contributor
Author
|
/ok to test 6437153 |
…into arajfer/sandbox-failures Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]> # Conflicts: # .agents/skills/gym-eval/SKILL.md
Contributor
Author
|
/ok to test 5fa42e9 |
…dbox-failures Main's #5536 moved the failure modules into their packages; this layer's imports, patch targets and moved test-module paths follow, and servers and agents import facade-served names from the facades. Import paths only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Contributor
Author
|
/ok to test 0e1d033 |
…ailures A tool output that opens with the text a harness returns when a tool could not run at all (starting with "ripgrep execution failed") now produces one tool_call_failed finding per rollout, with the number of such outputs in its detail. It is a label only: rewards, verdict rules for other checks and retry decisions are unchanged. OpenCode sandboxed agents without network access cannot download ripgrep, so every grep call fails. The agent now logs a warning at load when its sandbox has no network access (network_access, or enforce_agent_no_network on the resources server) and local_ripgrep_binary_path is not set. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…esource limit rollout_missing_agent_turns still reports a rollout with no agent turns. When the record carries sandbox_resource_limit, its detail now also holds expected_absence = sandbox_resource_limit:<resource>, so a reader can tell the missing turns follow a provider-ended sandbox. The finding, the reward and retry decisions are unchanged. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ailure event An OpenCode sandboxed agent run whose staging upload or agent exec raises TimeoutError or SandboxBackendUnreachableError, and whose error reports no provider-ended sandbox, now observes a sandbox failure event beside the failure it already reports: transport_timeout for a timeout and provider_unavailable for an unreachable backend, at stage seed for the uploads and agent for the exec, with the call named as the operation. This only observes. The raised error, the route failure, the retry decision and the counts-as-zero marker are unchanged; a provider-ended sandbox keeps its existing typed event, and an error never yields two events. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ll_failed The check emits one finding per rollout with a count, so it is a rollout-subject check and its id starts with rollout_. This drops the CheckSubject.TOOL_CALL member the previous commit added, so no public enum is added. Behavior is otherwise unchanged. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Five known gaps, each to be fixed later: the harness agent retries its own memory kill as a masked result; Terminal-Bench 4 counts a helper-container memory kill as the agent zero; a memory kill that names no container is attributed to the agent; a storage eviction is a model zero in Terminal-Bench 4 but an infrastructure retry in the OpenCode path; and Terminal-Bench 4 scores verifier timeouts and missing reward files as unmasked zeros while DeepSWE masks and re-verifies them. No behavior changes. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
After the core and utils module moves, the library's tests import each name from its defining module and the agent's tests from the package's public API, as the facade tests require. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in the base branch's latest documentation, message and skill fixes. No conflicts; nothing changed in this branch's own code. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Contributor
Author
|
/ok to test d9ce80f |
Contributor
Brings in the base branch's latest head, which merges main through #5564 (the episode modules split into types, context and failure records) and later main changes. This layer's imports of moved names follow the new modules. Import paths only. SandboxFailureDetails moved to nemo_gym.core.failure_records; this branch's container field and its docstring move with it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Contributor
Author
|
/ok to test ff66e96 |
Signed-off-by: Adam Rajfer <[email protected]>
Contributor
Author
|
/ok to test f553e73 |
Brings in the base branch's merge of main, which now carries #5343 as one squashed commit. The tree is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Contributor
Author
|
/ok to test 3b55e4e |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a sandboxed episode ends abnormally, Gym's treatment depends on the benchmark and the agent that observed it. A memory kill of the agent's container is scored 0 by one benchmark, masked and retried as infrastructure by another, and reaches collection as a generic agent route failure in a third. The cause, phase and container are recovered from free text by four separate matchers.
What this PR does
sandboxfailure boundary andSandboxFailureDetailsfrom feat(failures): add typed boundary details #5505 and adds thecontainerfield. The provider's ended-sandbox report is read in one place (nemo_gym.sandbox.failure_details): the provider's reason code as reported (OOMKilled,Evicted,Error), the cause (oom,evicted,storage,unknown) and, when the report names it, which container ended (the agent's, an init container or a sidecar). The kind follows the typed reason: the agent's own memory kill isprovider_oom_killed, and any other ending, including evictions and a helper container's memory kill, isprovider_unavailable.OOMKilledof the agent's own sandbox at stageagentis a final zero: counted in the denominator and never retried. Kills during setup or verification, a helper container's memory kill and any other provider reason stay infrastructure retries.rollout_tool_call_failedfinding for tool outputs that report a harness tool failure, and a warning when the coding agent's sandbox has no network access and no localrgbinary is configured, because its search tools then fail.Behaviour notes
Errorbut whose text saysexited with code 137is nowprovider_unavailable, notprovider_oom_killed; both are retried.Known limitations
Relation to #5127–#5129
#5127, #5128 and #5129 cover much of the same ground with a different design, and they are the base for this area:
containerfield overlap with that; after fix(sandbox): report OpenSandbox failures through shared contracts #5127 lands, this PR uses fix(sandbox): report OpenSandbox failures through shared contracts #5127's contract and keeps only what it does not cover (the eviction and storage cause, and which container ended when the provider names one).count_as_zeroper environment, used by DeepSWE). This PR's single collection-wide rule competes with that and is dropped in favour of it; the recovery and health-gate handling of the resulting zero follows fix(deepswe): score confirmed OOMs and reject incomplete verification #5129's marker.Not in this PR (follow-ups)
verifier_errorinstead of saved as an unmasked 0.Validation
🤖 Generated with Claude Code