Repository navigation
fix(sandbox): accept mini_swe_agent_2's resource_requests on E2B - #5597
Conversation
mini_swe_agent_2 ships OpenSandbox scheduling hints under sandbox_spec.provider_options.resource_requests. The E2B provider rejected them as unknown options, so the stock agent config could not run on E2B and the key cannot be removed with a Hydra override. E2B fixes resources when the template is built, so handle these hints the same way as SandboxSpec.resources: warn once per template, or raise with create.strict_resources. Other unknown options are still rejected before allocation. Signed-off-by: Maksim Obukhov <[email protected]>
Signed-off-by: Maksim Obukhov <[email protected]>
OpenSandbox also accepts resource_requests: "limits" (requests equal to the limits). On E2B that adds nothing beyond SandboxSpec.resources, which already warn, so accept it without a second warning. Check the type with 'is not None' so falsy non-mappings such as [] or 0 are rejected too. Signed-off-by: Maksim Obukhov <[email protected]>
|
hey @hemildesai, could you give this an |
hemildesai
left a comment
There was a problem hiding this comment.
Thanks! This is a sensible fix, and the end-to-end SWE-bench runs on hosted E2B are much appreciated.
Treating scheduling resource_requests like SandboxSpec.resources (warn by default, raise under create.strict_resources) is consistent with how E2B already handles template-fixed resources. Validation also matches the OpenSandbox provider: a mapping or "limits", rejected before any sandbox is created. The tests cover the warning, strict, "limits" and invalid-value paths, and the README and Fern docs are updated in both places.
No changes requested. One heads-up: #5509 also touches e2b/provider.py and tests/unit_tests/test_e2b_provider.py, so whichever lands second may need a small rebase.
tests/unit_tests/test_e2b_provider.py passes locally on this head (144 passed, 9 skipped). CI hasn't run yet; I'll approve once it has been triggered and is green.
|
/ok to test b186e2d |
hemildesai
left a comment
There was a problem hiding this comment.
CI is green on b186e2d. The only failures are the non-blocking harness conformance (kilocode) probes, which this PR doesn't touch. Approving. Thanks for the fix and the thorough validation!
Merge captured base 95c841b into captured PR head b186e2d. Keep the automatic merge unchanged, including the relocated E2B resource-request tests. Signed-off-by: svcnemo-autobot <[email protected]>
|
/ok to test 45bbee6 |
hemildesai
left a comment
There was a problem hiding this comment.
Re-approving after the merge from main (45bbee6), which dismissed my earlier approval. The PR's own changes are the same as the version I reviewed (only the tests moved to tests/unit_tests/sandbox/ along with main), and CI is green on this head.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43989403627 |
|
@hemildesai thanks for the approval. The merge queue dropped this PR on |
|
@hemildesai the merge queue removed this at 00:56 UTC on one failure in It looks flaky. The test passes on our machine with this PR's head (8 of 8 runs when idle), and fails with the same assertion when I load the CPU. The PR only touches the E2B sandbox provider. Could you re-add it to the merge queue? Thanks! |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/44174092933 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/44189824446 |
Main's NVIDIA-NeMo#6165 adds a resources_servers/ether0 entry to scripts/component-lock-policy.json next to this branch's resources_servers/critpt_custom_grader entry. Both entries are kept, in sorted order. Main's NVIDIA-NeMo#5597 changes no file this branch changes. Signed-off-by: Erik Arakelyan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
What does this PR do?
The stock
mini_swe_agent_2config setssandbox_spec.provider_options.resource_requests, a scheduling hint for OpenSandbox. The E2B provider rejected any provider option excepttemplate, so the agent could not start on E2B without copying and editing its config. A Hydra override can't remove the key, and setting it tonullbreaks the provider.E2B fixes CPU and memory when a template is built, so the provider now treats scheduling
resource_requeststhe same way it already treatsSandboxSpec.resources: it logs a warning, or raises whencreate.strict_resourcesis true.resource_requests: "limits"(requests equal toresources) is accepted without an extra warning. Other unknown keys and invalid values are still rejected before a sandbox is created.The E2B provider README and the Fern page document the option.
Validation
tests/unit_tests/test_e2b_provider.py: warns when not strict, raises when strict,"limits"adds no extra warning, invalid values are rejected before create. The new tests fail onmain.main:test_e2b_provider.pyandtest_sandbox.pypass (214 passed, 2 skipped).pre-commit runon the changed files: passed.Rollouts
Ran the stock
mini_swe_agent_2.yaml+nemo_gym/sandbox/providers/e2b/configs/e2b.yamlagainst hosted E2B, with one E2B template per SWE-bench image built bypython -m nemo_gym.sandbox.providers.e2b.build(2 vCPU, 8192 MB). Driver: radixark/miles'eval_nemogym_via_api.py.data/example.jsonl, 5 concurrentttl_s: 18000gemini-3.5-flash-lite), 2 tasksOn
mainthe same command fails at sandbox creation withUnknown E2B provider option(s): resource_requests. Results and trajectories: https://gist.github.com/max-sudolabs/60db49c420fa292fb7dbdbb0a1575d9eCompatibility and benchmark impact
Configs that set
resource_requestsand failed on E2B now start, with a warning. Withcreate.strict_resources: truethey still fail, now with the resource error instead of the unknown-option error. No change for other providers.Checklist
git commit -s).