Skip to content

fix(sandbox): confirm OOM from control-plane lifecycle reports - #5605

Merged
AdamRajfer merged 5 commits into
mainfrom
arajfer/sandbox-details-on-5129
Nov 6, 2026
Merged

AdamRajfer merged 5 commits into
mainfrom
arajfer/sandbox-details-on-5129

Conversation

@AdamRajfer

@AdamRajfer AdamRajfer commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

A command-status HTTP 410 response can contain an ended report from the sandbox process, even when routed through the server proxy. OpenSandbox now confirms OOM from the control plane's persisted lifecycle report, requiring the requested sandbox ID, its single owned pod, the user container, and an explicit current termination reason. The same bounded lookup serves command execution and PTY loss, including after the pod disappears.

This replaces the unmerged diagnostics.ended_report_oom option. Generic lifecycle reasons and unrecognized, sidecar, init, pooled or contradictory reports remain unconfirmed; HTTP 410 bodies and causal failures remain available for diagnosis. Scoring and health attribution continue to use the shared recorded policy decision from the stack below. This fourth PR builds on #5129; it needs no separate issue because it completes the sandbox failure work in #5127.

The reported container exit code remains in the diagnostic reason; SandboxFailureDetails.exit_code stays unset when the command exit was not observed. This addresses the container-versus-command evidence distinction raised in review.

Review clarifications

This supersedes the earlier plan to fold a narrow HTTP-410 ended-body interpretation into #5127: the sandbox process can supply that body, so it cannot independently prove the cause of its own termination. This PR uses the persisted control-plane report and remains the fourth stack member.

The supported parser names the user-container and single-pod suffix assumptions explicitly; it does not claim support for arbitrary deployment layouts. Lifecycle evidence is considered before optional inspect fallback. The lifecycle test module now reflects that source, and a real SDK 410 regression under both FAIL and RETRY verifies that command retry does not introduce diagnostic polling.

Validation:

Compatibility: remove diagnostics.ended_report_oom from configurations using the unmerged option. Recognized lifecycle evidence is checked by default; the existing diagnostics.inspect_oom fallback remains optional. No benchmark-specific scoring rule or new failure-record field is introduced.

Existing diagnostic bounds still apply: a full request failure log can omit a later OOM event, in which case consumers retain the omission marker and do not infer a scored OOM without its canonical event. This change does not redesign report capacity or other benchmark consumers.

Latest review fixes: the final assembled selection at 6f247486a3ff58b72ca9d83933960f4c547e6c2d passed 949 tests; scoped pre-commit and import-linter passed. Individual fixes received independent Claude review and one fix pass. These checks do not assert full repository CI or benchmark-wide score invariance.

@AdamRajfer AdamRajfer self-assigned this Nov 4, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

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.

@AdamRajfer

Copy link
Copy Markdown
Contributor Author

/ok to test 0843585

@AdamRajfer

Copy link
Copy Markdown
Contributor Author

/ok to test fa7f46c

@AdamRajfer

Copy link
Copy Markdown
Contributor Author

A real-task run of DeepSWE's OOM form on this head still ended as a retryable provider_unavailable (command status 410, container already gone) instead of the model's zero; details in #5127 (comment).

@AdamRajfer

Copy link
Copy Markdown
Contributor Author

Correction to the line above: the provider did report the OOM in the 410 body (SANDBOX::ENDED, "has ended (OOMKilled)", exit code 137); the command-status path just doesn't read it, so the row is typed provider_unavailable. Suggested fix is in the #5127 thread: #5127 (comment).

@AdamRajfer

Copy link
Copy Markdown
Contributor Author

/ok to test eb9568f

@AdamRajfer

Copy link
Copy Markdown
Contributor Author

Giulio is folding this into #5127 and taking it over. The commit to take is eb9568f, the provider fix plus its tests (2 files); nothing from the base branch. The tests are the three parametrized 410-ended cases (agent_oom, sidecar_oom, evicted). On #5127 alone, the details.container == "agent" assertion has to go, since that field comes from another commit here.

@giuliolovisotto
giuliolovisotto force-pushed the arajfer/sandbox-details-on-5129 branch from eb9568f to 1af5748 Compare November 5, 2026 14:19
@giuliolovisotto giuliolovisotto changed the title fix(gate): count an agent sandbox OOM zero as the model's result fix(sandbox): confirm OOM from control-plane lifecycle reports Nov 5, 2026
Signed-off-by: Giulio Lovisotto <[email protected]>
(cherry picked from commit 3ecb8478b9c5c07bc79c0d8e01379004d690f885)
An expired retire may mark an attempt before its cleanup runs. Refuse to publish such records and cache an export failure with recovery instructions.

Signed-off-by: Giulio Lovisotto <[email protected]>
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 6, 2026 08:57
@giuliolovisotto

Copy link
Copy Markdown
Contributor

Fixed the failing checkpoint-worker CI case in 31862c7. An expired retire request could mark an attempt without stopping it, allowing a later checkpoint to export it; the shared commit path now refuses those records before writing and returns a cached export failure with recovery instructions.

Added a deterministic regression without changing the randomized test. All 456 checkpoint environment/control/sequence/worker/resource tests and scoped pre-commit checks pass. Independent review requested the explicit export-failure contract; that correction is included. Fresh CI is running, so full CI success is not yet confirmed.

@giuliolovisotto

Copy link
Copy Markdown
Contributor

CI is green at 31862c7 after rerunning the failed jobs: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42191364027/attempts/2

The checkpoint regression passed. The subsequent failures were the process-supervisor grace-cleanup test and Scale-SWE bounded shutdown test; both passed unchanged on rerun. Before rerunning, the exact Linux cleanup driver passed 20 consecutive local runs and all 53 Scale-SWE session tests passed. No source changes or test skips were added for these intermittent failures.

@giuliolovisotto
giuliolovisotto enabled stacked auto-merge November 6, 2026 09:55
@giuliolovisotto
giuliolovisotto self-requested a review November 6, 2026 09:56
@giuliolovisotto
giuliolovisotto added this pull request to the merge queue Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42198947704

@giuliolovisotto
giuliolovisotto removed this pull request from the merge queue due to a manual request Nov 6, 2026
@AdamRajfer
AdamRajfer added this pull request to the merge queue Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42201681584

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 6, 2026
@AdamRajfer
AdamRajfer added this pull request to the merge queue Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42210193125

Merged via the queue into main with commit 5883853 Nov 6, 2026
105 of 110 checks passed

This branch was previously deployed

1 inactive deployment
public — 31862c78 Deployed Nov 6, 2026 by copy-pr-bot[bot] via release / finalize / notify #10598
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants