feat(sandbox): validate OpenSandbox provider_options via a frozen dataclass - #1713
Merged
kajalj22 merged 1 commit intoJun 30, 2026
Conversation
hemildesai
force-pushed
the
ansubramania/sandbox-provider-options-dataclass
branch
from
June 26, 2026 22:13
d8bd80e to
1c9c9d2
Compare
hemildesai
previously approved these changes
Jun 27, 2026
hemildesai
force-pushed
the
ansubramania/sandbox-provider-options-dataclass
branch
from
June 27, 2026 05:22
1c9c9d2 to
0f2fca2
Compare
hemildesai
previously approved these changes
Jun 27, 2026
hemildesai
disabled the stack merge
June 29, 2026 16:50
hemildesai
force-pushed
the
ansubramania/sandbox-provider-options-dataclass
branch
from
June 29, 2026 16:50
0f2fca2 to
f858e6d
Compare
hemildesai
approved these changes
Jun 29, 2026
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
hemildesai
previously approved these changes
Jun 29, 2026
kajalj22
disabled the stack merge
June 30, 2026 16:17
…aclass Represent the recognized per-sandbox create options (spec.provider_options) as a frozen OpenSandboxProviderOptions dataclass with a validating from_mapping, so the supported options and their types are discoverable in one place and unknown keys are rejected with a clear error. The create path now reads typed attributes instead of scattered dict lookups. SDK-owned nested structures (platform, volumes) stay pass-through mappings so their inner fields remain validated by the OpenSandbox SDK rather than over-constrained here. Refs #1377 Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
kajalj22
force-pushed
the
ansubramania/sandbox-provider-options-dataclass
branch
from
June 30, 2026 16:25
20e44fb to
3886e93
Compare
hemildesai
approved these changes
Jun 30, 2026
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 #1712. Addresses the open review thread on #1377 (here) 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 frozenOpenSandboxProviderOptionsdataclass with a validatingfrom_mapping:platform,snapshot_id,volumes,skip_health_check,extensions).provider_options.get(...)lookups, replacing the ad-hoc_spec_extensions/_provider_option_bool/_spec_volumeshelpers.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
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)uv run ruff check+ruff format --checkclean