feat(sandbox): discover sandbox providers via entry points - #1712
Merged
kajalj22 merged 2 commits intoJun 30, 2026
Conversation
3 tasks
hemildesai
force-pushed
the
ansubramania/sandbox-provider-entry-points
branch
from
June 26, 2026 22:13
4043a11 to
7ed6b8c
Compare
hemildesai
previously approved these changes
Jun 27, 2026
hemildesai
force-pushed
the
ansubramania/sandbox-provider-entry-points
branch
from
June 27, 2026 05:22
7ed6b8c to
89aa965
Compare
hemildesai
previously approved these changes
Jun 27, 2026
hemildesai
force-pushed
the
ansubramania/sandbox-provider-entry-points
branch
from
June 29, 2026 16:50
89aa965 to
6c34d08
Compare
hemildesai
added a commit
that referenced
this pull request
Jun 29, 2026
Signed-off-by: Hemil Desai <hemild@nvidia.com>
hemildesai
approved these changes
Jun 29, 2026
hemildesai
approved these changes
Jun 29, 2026
hemildesai
added a commit
that referenced
this pull request
Jun 29, 2026
Signed-off-by: Hemil Desai <hemild@nvidia.com>
hemildesai
approved these changes
Jun 29, 2026
hemildesai
added a commit
that referenced
this pull request
Jun 29, 2026
hemildesai
approved these changes
Jun 29, 2026
Add a `nemo_gym.sandbox_providers` entry point group so a separate package can publish a sandbox provider that becomes available on install/import, without editing the registry. Lookup precedence is explicit registration > built-in loaders > entry points; discovery is cached. Refs #1377 Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Two installed distributions publishing the same provider entry-point name now raise a clear error naming both packages, instead of silently picking one nondeterministically. An entry point shadowed by a higher-precedence built-in or registered provider is logged as a warning and ignored. Refs #1377 Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
kajalj22
force-pushed
the
ansubramania/sandbox-provider-entry-points
branch
from
June 30, 2026 16:25
8195954 to
b0698c3
Compare
kajalj22
pushed a commit
that referenced
this pull request
Jun 30, 2026
…aclass (#1713) ## Summary Stacked on top of #1712. Addresses the open review thread on #1377 ([here](#1377 (comment))) asking whether the individual provider options should be frozen dataclasses so the supported options + validation are discoverable. Represents the recognized per-sandbox create options (`SandboxSpec.provider_options`) as a frozen `OpenSandboxProviderOptions` dataclass with a validating `from_mapping`: - Supported options and their types now live in one place (`platform`, `snapshot_id`, `volumes`, `skip_health_check`, `extensions`). - Unknown keys and wrong types are rejected with clear errors. - The create path reads typed attributes instead of scattered `provider_options.get(...)` lookups, replacing the ad-hoc `_spec_extensions` / `_provider_option_bool` / `_spec_volumes` helpers. ### Design note SDK-owned nested structures (`platform`, `volumes`) are kept as pass-through mappings rather than strictly-typed sub-dataclasses, so their inner fields stay validated by the OpenSandbox SDK and we don't over-constrain options we don't own. Refs #1377 ## Test plan - [x] `uv run pytest tests/unit_tests/test_opensandbox_provider.py tests/unit_tests/test_sandbox.py responses_api_agents/mini_swe_agent_2/tests/test_app.py` (40 passed, 11 skipped) - [x] `uv run ruff check` + `ruff format --check` clean - [x] Create-path behavior (platform passthrough, image-pull-policy extensions, skip_health_check) preserved under the fake-SDK tests Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
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.
Summary
Stacked on top of #1709. Addresses the open review thread on #1377 (here) asking to support an entry-points configuration so users can plug in their own providers.
Adds a
nemo_gym.sandbox_providersentry point group. A separate package can publish a sandbox provider that becomes available on install/import — no edits to the registry:Lookup precedence is explicit
register_provider> built-in loaders > entry points; discovery is cached.list_providers()now unions all three sources.Changes
nemo_gym/sandbox/providers/registry.py: addENTRY_POINT_GROUP, cached_entry_point_loaders(), and fold entry points intoget_provider_class/list_providers.Refs #1377
Test plan
uv run pytest tests/unit_tests/test_sandbox.py tests/unit_tests/test_opensandbox_provider.py(23 passed, 11 skipped)uv run ruff checkclean