Skip to content

feat(sandbox): add Tensorlake sandbox backend#1

Open
cooleel wants to merge 1 commit into
mainfrom
sw/add_tensorlake_sandbox
Open

feat(sandbox): add Tensorlake sandbox backend#1
cooleel wants to merge 1 commit into
mainfrom
sw/add_tensorlake_sandbox

Conversation

@cooleel
Copy link
Copy Markdown

@cooleel cooleel commented May 5, 2026

Summary

Adds a Tensorlake-backed sandbox provider underagents.extensions.sandbox.tensorlake, following the existing extension pattern used by the other cloud backends. The tensorlake SDK is imported lazily so users without the extra can still import the package.

Highlights

  • Installable via uv sync --extra tensorlake (or pip install "openai-agents[tensorlake]").
  • pause_on_exit for suspend/resume of named sandboxes.
  • Two workspace persistence modes: "tar"and "snapshot".
  • Additive change — no existing public APIs are affected.

Includes a docs reference page, a manual runner example at examples/sandbox/extensions/tensorlake_runner.py, and a unit test suite.

Demo

import asyncio
import sys
from pathlib import Path

from agents import ModelSettings, Runner
from agents.extensions.sandbox import (
  DEFAULT_TENSORLAKE_WORKSPACE_ROOT,
  TensorlakeSandboxClient,
  TensorlakeSandboxClientOptions,
)
from agents.run import RunConfig
from agents.sandbox import Manifest, SandboxAgent, SandboxRunConfig
from agents.sandbox.entries import File

if __package__ is None or __package__ == "":
  sys.path.insert(0, str(Path(__file__).resolve().parents[3]))

from examples.sandbox.misc.workspace_shell import WorkspaceShellCapability 


async def main() -> None:
  manifest = Manifest(
      root=DEFAULT_TENSORLAKE_WORKSPACE_ROOT,
      entries={
          "README.md": File(content=b"# Tensorlake demo workspace\n"),
          "todo.md": File(content=b"1. Inspect files.\n2. Summarize.\n"),
      },
  )

  agent = SandboxAgent(
      name="Tensorlake Demo",
      model="gpt-5.5",
      instructions="Inspect the workspace and summarize it in two sentences.",
      default_manifest=manifest,
      capabilities=[WorkspaceShellCapability()],
      model_settings=ModelSettings(tool_choice="required"),
  )

  run_config = RunConfig(
      sandbox=SandboxRunConfig(
          client=TensorlakeSandboxClient(),
          options=TensorlakeSandboxClientOptions(
              workspace_persistence="snapshot",
              timeout_secs=300,
          ),
      ),
      workflow_name="Tensorlake demo",
  )

  result = await Runner.run(agent, "Summarize the workspace.", run_config=run_config)
  print(result.final_output)


if __name__ == "__main__":
  asyncio.run(main())

Run it with OPENAI_API_KEY and TENSORLAKE_API_KEY exported.

Test plan

  • make lint, make format, make typecheck, make tests pass locally.
  • Manual validation via examples/sandbox/extensions/tensorlake_runner.py
    against a live Tensorlake account.

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

@cooleel cooleel force-pushed the sw/add_tensorlake_sandbox branch from b926f5a to a6a1719 Compare May 20, 2026 19:21
@cooleel cooleel changed the title Add Tensorlake as a sandbox option Add Tensorlake sandbox backend May 20, 2026
@cooleel cooleel changed the title Add Tensorlake sandbox backend feat(sandbox): add Tensorlake sandbox backend May 20, 2026
@cooleel cooleel force-pushed the sw/add_tensorlake_sandbox branch from dfcd5d7 to c2df6ef Compare May 22, 2026 05:26
@cooleel cooleel force-pushed the sw/add_tensorlake_sandbox branch from c2df6ef to e0268e0 Compare May 23, 2026 04:43
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.

1 participant