[PR #900] [MERGED] feat(sdk,cli): sandbox provider interface #972

Closed
opened 2026-02-16 09:17:47 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagents/pull/900
Author: @eyurtsev
Created: 1/23/2026
Status: Merged
Merged: 2/3/2026
Merged by: @eyurtsev

Base: masterHead: eugene/add_sandbox_provider


📝 Commits (10+)

📊 Changes

8 files changed (+1005 additions, -260 deletions)

View changed files

📝 libs/cli/deepagents_cli/integrations/daytona.py (+106 -2)
📝 libs/cli/deepagents_cli/integrations/modal.py (+102 -2)
📝 libs/cli/deepagents_cli/integrations/runloop.py (+91 -1)
📝 libs/cli/deepagents_cli/integrations/sandbox_factory.py (+68 -252)
📝 libs/cli/pyproject.toml (+1 -1)
📝 libs/deepagents/deepagents/backends/sandbox.py (+354 -0)
📝 libs/deepagents/pyproject.toml (+2 -2)
libs/deepagents/tests/unit_tests/test_sandbox_provider.py (+281 -0)

📄 Description

Add SandboxProvider Abstraction

Adds a SandboxProvider protocol for third-party sandbox integrations. Migrated existing Modal, Runloop, and Daytona implementations to use it.

Usage

from deepagents.backends.sandbox import SandboxProvider

class MyProvider(SandboxProvider):
    def list(self, *, cursor=None, **kwargs):
        # Return available sandboxes
        return {"items": [...], "cursor": None}
    
    def get_or_create(self, *, sandbox_id=None, **kwargs):
        # Create new or connect to existing sandbox
        if sandbox_id:
            sandbox = self._client.get(sandbox_id)
        else:
            sandbox = self._client.create()
        return MySandboxBackend(sandbox)
    
    def delete(self, sandbox_id, **kwargs):
        # Clean up sandbox
        self._client.terminate(sandbox_id)

# Use it
provider = MyProvider()
sandbox = provider.get_or_create()
result = sandbox.execute("echo hello")
provider.delete(sandbox.id)

The deepagents CLI now uses this pattern for Modal, Runloop, and Daytona


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagents/pull/900 **Author:** [@eyurtsev](https://github.com/eyurtsev) **Created:** 1/23/2026 **Status:** ✅ Merged **Merged:** 2/3/2026 **Merged by:** [@eyurtsev](https://github.com/eyurtsev) **Base:** `master` ← **Head:** `eugene/add_sandbox_provider` --- ### 📝 Commits (10+) - [`ee05277`](https://github.com/langchain-ai/deepagents/commit/ee05277048f05b25947d854f5c35fb86d024d85c) x - [`5dd2a2d`](https://github.com/langchain-ai/deepagents/commit/5dd2a2df7f4f87c3919e4374e3a8efadc6d9a7dc) x - [`3ce0b36`](https://github.com/langchain-ai/deepagents/commit/3ce0b368714d1c8da7cd9efeda7a0af02dd77414) x - [`07ee1f0`](https://github.com/langchain-ai/deepagents/commit/07ee1f0f2070f47d1c30590c8ff645ca8ccb0f31) x - [`5c734ad`](https://github.com/langchain-ai/deepagents/commit/5c734ad5dcf64bbc5f1e3d8399d0adf40430f347) x - [`6715a50`](https://github.com/langchain-ai/deepagents/commit/6715a503e69f9fc42f6b5c13c1c7b29e657f5f99) x - [`2d18d3f`](https://github.com/langchain-ai/deepagents/commit/2d18d3fa476ebf31b95553581a42b099368e6e72) x - [`0f708af`](https://github.com/langchain-ai/deepagents/commit/0f708af42e64296755b33dfd07fa0ebfbfbf274a) x - [`a43ca73`](https://github.com/langchain-ai/deepagents/commit/a43ca73076550201983a1bd25daaa2448fdb36d7) x - [`95ca744`](https://github.com/langchain-ai/deepagents/commit/95ca744ffefbb9bd7cc2029592856e976709fb0b) x ### 📊 Changes **8 files changed** (+1005 additions, -260 deletions) <details> <summary>View changed files</summary> 📝 `libs/cli/deepagents_cli/integrations/daytona.py` (+106 -2) 📝 `libs/cli/deepagents_cli/integrations/modal.py` (+102 -2) 📝 `libs/cli/deepagents_cli/integrations/runloop.py` (+91 -1) 📝 `libs/cli/deepagents_cli/integrations/sandbox_factory.py` (+68 -252) 📝 `libs/cli/pyproject.toml` (+1 -1) 📝 `libs/deepagents/deepagents/backends/sandbox.py` (+354 -0) 📝 `libs/deepagents/pyproject.toml` (+2 -2) ➕ `libs/deepagents/tests/unit_tests/test_sandbox_provider.py` (+281 -0) </details> ### 📄 Description # Add SandboxProvider Abstraction Adds a `SandboxProvider` protocol for third-party sandbox integrations. Migrated existing Modal, Runloop, and Daytona implementations to use it. ## Usage ```python from deepagents.backends.sandbox import SandboxProvider class MyProvider(SandboxProvider): def list(self, *, cursor=None, **kwargs): # Return available sandboxes return {"items": [...], "cursor": None} def get_or_create(self, *, sandbox_id=None, **kwargs): # Create new or connect to existing sandbox if sandbox_id: sandbox = self._client.get(sandbox_id) else: sandbox = self._client.create() return MySandboxBackend(sandbox) def delete(self, sandbox_id, **kwargs): # Clean up sandbox self._client.terminate(sandbox_id) # Use it provider = MyProvider() sandbox = provider.get_or_create() result = sandbox.execute("echo hello") provider.delete(sandbox.id) ``` The deepagents CLI now uses this pattern for Modal, Runloop, and Daytona --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 09:17:47 -05:00
yindo closed this issue 2026-02-16 09:17:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagents#972