Skip to content

feat(sandbox): implement ConnectableProvider for the OpenSandbox provider - #2084

Merged
ananthsub merged 1 commit into
ansubramania/sandbox-connectable-providerfrom
ansubramania/opensandbox-connectable
Jul 30, 2026
Merged

ananthsub merged 1 commit into
ansubramania/sandbox-connectable-providerfrom
ansubramania/opensandbox-connectable

Conversation

@ananthsub

@ananthsub ananthsub commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

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]

@copy-pr-bot

copy-pr-bot Bot commented Jul 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.

@ananthsub
ananthsub requested a review from hemildesai July 20, 2026 17:20
@ananthsub
ananthsub force-pushed the ansubramania/opensandbox-connectable branch from cba9a05 to 56de4c4 Compare July 20, 2026 17:28
@ananthsub
ananthsub marked this pull request as ready for review July 20, 2026 17:37
@ananthsub
ananthsub force-pushed the ansubramania/opensandbox-connectable branch from 56de4c4 to 1ea46fc Compare July 20, 2026 17:41
@copy-pr-bot

copy-pr-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Jul 21, 2026
@ananthsub
ananthsub force-pushed the ansubramania/opensandbox-connectable branch from 1ea46fc to b6ea639 Compare July 28, 2026 20:03
hemildesai
hemildesai previously approved these changes Jul 30, 2026
@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label 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
ananthsub force-pushed the ansubramania/opensandbox-connectable branch from b6ea639 to 033e8d4 Compare July 30, 2026 17:37
@ananthsub
ananthsub requested a review from hemildesai July 30, 2026 17:45
@ananthsub
ananthsub merged commit ba167e0 into main Jul 30, 2026
16 checks passed
@ananthsub
ananthsub deleted the ansubramania/opensandbox-connectable branch July 30, 2026 17:49
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants