Migrate sandbox backend to together-sandbox SDK#734
Open
necoline wants to merge 3 commits into
Open
Conversation
New files: - tinker_cookbook/sandbox/codesandbox_sandbox.py: SandboxInterface implementation using the Bartender API for lifecycle and Pint for in-sandbox operations - tinker_cookbook/recipes/harbor_rl/scripts/eval_terminal_bench_csb.py: eval script that uses the CSB backend instead of Modal The CSB adapter handles: - Docker image build + push to CSB registry - Snapshot creation with alias-based caching - Sandbox start + wait for running state - Command execution via Pint (login shell, cd-based workdir) - File read/write via Pint - DNS configuration on sandbox start Tested: 3/5 Terminal-Bench tasks completed with 0 sandbox errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mirrors train_terminal_bench.py but uses csb_sandbox_factory instead of Modal's default_sandbox_factory. Same interface as the eval script. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…box SDK Replace the hand-rolled _BartenderClient and _PintClient HTTP classes (~516 lines) with a thin wrapper around the official together-sandbox Python SDK. The SDK handles Docker builds, snapshot management, sandbox lifecycle, command execution, and file operations. - Delete codesandbox_sandbox.py, add together_sandbox.py - Rename class CodeSandboxSandbox → TogetherSandbox - Auth: accept TOGETHER_API_KEY, CSB_API_KEY, or CSB_STREAM_API_KEY - Env vars for resources: CSB_CPU → TOGETHER_SANDBOX_CPU, etc. - Add together-sandbox git dependency to pyproject.toml - Tested end-to-end: snapshot cache hit, sandbox create/start, run_command, and cleanup all working Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
together-sandboxPython SDKCodeSandboxSandbox→TogetherSandbox, filecodesandbox_sandbox.py→together_sandbox.pyTOGETHER_API_KEY,CSB_API_KEY, orCSB_STREAM_API_KEYfor authTest plan
from tinker_cookbook.sandbox.together_sandbox import TogetherSandboxchess-best-move): snapshot cache hit, sandbox create/start,run_command("echo hello")→exit_code=0, stdout='hello\n', cleanup/shutdown🤖 Generated with Claude Code