Skip to content

feat(sandbox): add Tensorlake sandbox backend#3484

Open
cooleel wants to merge 2 commits into
openai:mainfrom
tensorlakeai:sw/add_tensorlake_sandbox
Open

feat(sandbox): add Tensorlake sandbox backend#3484
cooleel wants to merge 2 commits into
openai:mainfrom
tensorlakeai:sw/add_tensorlake_sandbox

Conversation

@cooleel
Copy link
Copy Markdown

@cooleel cooleel commented May 21, 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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 666a4c75b2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/tensorlake/sandbox.py
Comment thread src/agents/extensions/sandbox/tensorlake/sandbox.py
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd014dcd95

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/tensorlake/sandbox.py
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ebae66da71

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/tensorlake/sandbox.py
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfcd5d7eb0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/tensorlake/sandbox.py Outdated
Comment thread src/agents/extensions/sandbox/tensorlake/sandbox.py
@cooleel cooleel force-pushed the sw/add_tensorlake_sandbox branch from dfcd5d7 to c2df6ef Compare May 22, 2026 05:26
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2df6efe67

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/tensorlake/sandbox.py Outdated
@cooleel cooleel force-pushed the sw/add_tensorlake_sandbox branch from c2df6ef to e0268e0 Compare May 23, 2026 04:43
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0268e014f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/tensorlake/sandbox.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants