Repository navigation
feat(sandbox): implement ConnectableProvider for the OpenSandbox provider - #2084
Merged
ananthsub merged 1 commit intoJul 30, 2026
Conversation
|
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. |
2 tasks done
ananthsub
force-pushed
the
ansubramania/opensandbox-connectable
branch
from
July 20, 2026 17:28
cba9a05 to
56de4c4
Compare
ananthsub
marked this pull request as ready for review
July 20, 2026 17:37
ananthsub
force-pushed
the
ansubramania/opensandbox-connectable
branch
from
July 20, 2026 17:41
56de4c4 to
1ea46fc
Compare
ananthsub
force-pushed
the
ansubramania/opensandbox-connectable
branch
from
July 28, 2026 20:03
1ea46fc to
b6ea639
Compare
hemildesai
previously approved these changes
Jul 30, 2026
…ider
OpenSandbox sandboxes are reachable by id, so add serialize_handle (returns
{"sandbox_id": ...}) and connect (rebuilds a handle via Sandbox.connect(id)).
This lets an OpenSandbox-backed box be operated from another process without
a sandbox server. Tests mock the SDK and assert the provider satisfies the
ConnectableProvider protocol and round-trips a descriptor.
Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub
force-pushed
the
ansubramania/opensandbox-connectable
branch
from
July 30, 2026 17:37
b6ea639 to
033e8d4
Compare
hemildesai
approved these changes
Jul 30, 2026
ananthsub
added a commit
that referenced
this pull request
Jul 30, 2026
…ct facade (#2083) ## Summary Part of #2082 Bottom of a 3-PR stack for cross-server sandbox sharing. Introduces the optional provider capability and the sandbox-facade methods that use it. No in-tree provider implements the capability yet; the next PRs add OpenSandbox and the sandbox server. Stack: 1. **#2083 (this PR)** — ConnectableProvider + serialize/connect facade 2. #2084 — OpenSandbox implements ConnectableProvider 3. #2085 — sandbox server ## What's here - **`ConnectableProvider`** — an optional `runtime_checkable` protocol (`serialize_handle` / `connect`), separate from the base `SandboxProvider` (which is unchanged). Capability membership is checked with `isinstance`, so new capabilities can be added as their own protocols instead of growing one interface. - **`AsyncSandbox.serialize(scope=...)` / `AsyncSandbox.connect(descriptor, *, provider=...)`** — facade methods that delegate to the capability and raise for providers that do not support it. There is one live type (`SandboxHandle`); a descriptor is just its serialized form. ## Test plan - [x] `tests/unit_tests/test_sandbox_connect.py`: a fake `ConnectableProvider` exercises the `serialize` -> `connect` round-trip; `serialize`/`connect` raise for a provider without the capability; `isinstance` membership check. - [x] Existing sandbox tests pass; ruff clean. --------- Signed-off-by: Ananth Subramaniam <[email protected]>
OlegSudakov
pushed a commit
to OlegSudakov/Gym
that referenced
this pull request
Aug 7, 2026
…ct facade (NVIDIA-NeMo#2083) ## Summary Part of NVIDIA-NeMo#2082 Bottom of a 3-PR stack for cross-server sandbox sharing. Introduces the optional provider capability and the sandbox-facade methods that use it. No in-tree provider implements the capability yet; the next PRs add OpenSandbox and the sandbox server. Stack: 1. **NVIDIA-NeMo#2083 (this PR)** — ConnectableProvider + serialize/connect facade 2. NVIDIA-NeMo#2084 — OpenSandbox implements ConnectableProvider 3. NVIDIA-NeMo#2085 — sandbox server ## What's here - **`ConnectableProvider`** — an optional `runtime_checkable` protocol (`serialize_handle` / `connect`), separate from the base `SandboxProvider` (which is unchanged). Capability membership is checked with `isinstance`, so new capabilities can be added as their own protocols instead of growing one interface. - **`AsyncSandbox.serialize(scope=...)` / `AsyncSandbox.connect(descriptor, *, provider=...)`** — facade methods that delegate to the capability and raise for providers that do not support it. There is one live type (`SandboxHandle`); a descriptor is just its serialized form. ## Test plan - [x] `tests/unit_tests/test_sandbox_connect.py`: a fake `ConnectableProvider` exercises the `serialize` -> `connect` round-trip; `serialize`/`connect` raise for a provider without the capability; `isinstance` membership check. - [x] Existing sandbox tests pass; ruff clean. --------- Signed-off-by: Ananth Subramaniam <[email protected]>
OlegSudakov
pushed a commit
to OlegSudakov/Gym
that referenced
this pull request
Aug 7, 2026
…ider (NVIDIA-NeMo#2084) Part of NVIDIA-NeMo#2082 OpenSandbox sandboxes are reachable by id, so add serialize_handle (returns `{"sandbox_id": ...}` ) and connect (rebuilds a handle via Sandbox.connect(id)). This lets an OpenSandbox-backed box be operated from another process without a sandbox server. Tests mock the SDK and assert the provider satisfies the ConnectableProvider protocol and round-trips a descriptor. Signed-off-by: Ananth Subramaniam <[email protected]> Signed-off-by: Ananth Subramaniam <[email protected]>
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.
Part of #2082
OpenSandbox sandboxes are reachable by id, so add serialize_handle (returns
{"sandbox_id": ...}) and connect (rebuilds a handle via Sandbox.connect(id)).This lets an OpenSandbox-backed box be operated from another process without a sandbox server. Tests mock the SDK and assert the provider satisfies the ConnectableProvider protocol and round-trips a descriptor.
Signed-off-by: Ananth Subramaniam [email protected]