Skip to content

fix(deepswe): score confirmed agent sandbox OOM as zero - #4781

Draft
mpatel31415 wants to merge 2 commits into
NVIDIA-NeMo:mainfrom
mpatel31415:codex/deepswe-oom-zero-minimal
Draft

mpatel31415 wants to merge 2 commits into
NVIDIA-NeMo:mainfrom
mpatel31415:codex/deepswe-oom-zero-minimal

Conversation

@mpatel31415

@mpatel31415 mpatel31415 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Scope

This is the temporary, DeepSWE-only replacement for the OOM-scoring portion of #4685. It handles the observed agent-container OOM without adding shared sandbox/provider failure contracts.

Tracks issue #4783.

The current DeepSWE OpenCode leaf opts in on both the legacy sandboxed agent and its verifier. The agent runs setup before the agent command, so an OOM during setup cannot be classified as an agent outcome. When the agent command fails, the opt-in path queries the authenticated OpenSandbox inspect endpoint for that same sandbox ID. It accepts only the current sandbox container's Terminated (exit=137, reason=OOMKilled) state; exit 137 alone, an init-container or sidecar OOM, unavailable diagnostics, and other ambiguous errors retain existing failure handling. This uses the current OpenSandbox diagnostics endpoint locally in the legacy agent path as a short-term compatibility measure.

DeepSWE verifies the marker against its seeded task/image/sandbox, skips patch collection from the dead sandbox, and returns reward=0, mask_sample=false, failure_kind=provider_oom_killed, and the inspect evidence. This gives the affected task a normal scored rollout row, including in the aggregate denominator and require_complete count. It does not assign zero to unrelated provider, setup, verifier, or unconfirmed failures.

This PR changes only the DeepSWE leaf, DeepSWE verifier, legacy opencode_sandboxed_agent, and their focused tests. Local opencode_agent has no sandbox OOM to classify. The newer sandboxed agent-session interface is not used by this DeepSWE leaf and is outside this temporary fix. Shared sandbox/provider code and common failure contracts are untouched; the broader design belongs in separate work, per review on #4685.

Validation and evidence

  • Current main base: 4e4bcce60731c3ec0eb3a654cd1f6c29181a2b87.
  • Focused DeepSWE and legacy OpenCode tests: 99 passed, 2 skipped. They cover exception and returned-exit-code paths, authenticated inspect, rejection of ambiguous evidence, setup isolation, marker/session validation, unmasked zero, and the unchanged failure path when OOM is unconfirmed.
  • pre-commit run --all-files and git diff --check: passed.
  • Fresh local k3d/K3s smoke on earlier PR head d9dd5a597 used a synthetic OpenCode executable that allocated beyond the sandbox's fixed 256 MiB memory limit, triggering a real sandbox-container OOM. The Kubernetes container terminated with exitCode=137, reason=OOMKilled; authenticated inspect reported sandbox State: Terminated (exit=137, reason=OOMKilled). With a captured rollout ID, rollouts.jsonl contained one main row with reward=0.0, mask_sample=false, failure_kind=provider_oom_killed, model_patch_bytes=0, and the inspect evidence in its response metadata and failure reason. Its ng_agent_observations retained SandboxObservation(role=agent, provider=opensandbox, outcome=oom, exit_code=137, error_type=OOMKilled). The failures sidecar contained zero rows. Aggregation produced mean/reward=0.0, num_rollouts=1, expected_num_rollouts=1, missing_num_rollouts=0. This smoke used no model; it validates the real OOM scoring path, not model quality. A first local attempt lost its temporary port-forward during OOM and correctly left the failure unclassified; the passing run used a stable connection. No raw pod logs, credentials, task data, or evidence files are committed here.
  • A final integration audit found that splitting setup from agent execution moved the Shell: stdout marker used by completion detection. Head 6ac8907a5 now detects success from the isolated agent command; a focused successful-run regression test passed. The OOM classification and scoring paths are unchanged from the smoke-tested commit.
  • Pending before Ready: a representative model-backed rollout on current head 6ac8907a5. The prior three-task model-backed run on fix(deepswe): score confirmed agent sandbox OOMs as zero #4685 validated only that older commit.

Refs: Giulio's focused validation review, execution-path comment, and Hemil's shared-contract review.

@copy-pr-bot

copy-pr-bot Bot commented Oct 20, 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.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working labels Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants