Skip to content

feat(sandbox-tenki): add Tenki sandbox provider - #1

Closed
monoppa wants to merge 1 commit into
mainfrom
feat/sandbox-tenki
Closed

feat(sandbox-tenki): add Tenki sandbox provider#1
monoppa wants to merge 1 commit into
mainfrom
feat/sandbox-tenki

Conversation

@monoppa

@monoppa monoppa commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

Adds @voltagent/sandbox-tenki, a first-party WorkspaceSandbox provider that runs each execute_command inside a disposable Tenki Linux microVM via @tenkicloud/sandbox. Mirrors the existing E2B / Blaxel / Daytona providers.

What's included

  • TenkiSandbox implements WorkspaceSandbox on top of the SDK session run API: native cwd/env/stdin, per-command timeout + abort via kill(), separate stdout/stderr streams, and maxOutputBytes truncation. Lazy cached session (clear-on-failure), plus start/stop/destroy/getInfo/getInstructions/getSession.
  • createTenkiToolkit — optional preview-URL (expose_preview_url) and SSH-key (authorize_ssh_key) tools, isolated in tools.ts so they can be dropped without touching the core adapter.
  • README, docs page update (website/docs/workspaces/sandbox.md), and a changeset (minor).

SDK note / design deviation

The Tenki SDK's session.exec() ignores timeoutMs/signal; the real handle-based primitive is session.run(argv, { cwd, env, stdin }) (returns a ProcessRunHandle with stdout/stderr streams, stdin, kill(), and a signal in the result). The adapter is built on run() — it's the closest mirror to E2B's commands.run().wait()/kill() and the only way to actually enforce timeout/abort. Output bytes are decoded with TextDecoder; CommandTimeoutError is caught → timedOut.

Testing

  • pnpm --filter @voltagent/sandbox-tenki typecheck — clean
  • pnpm --filter @voltagent/sandbox-tenki build — CJS + ESM + d.ts (SDK externalized)
  • pnpm --filter @voltagent/sandbox-tenki test57 tests passing, 100% coverage (SDK fully mocked, no network)
  • Biome clean

Live end-to-end check against a real microVM was not run (no TENKI_API_KEY available in the dev environment).

@monoppa
monoppa force-pushed the feat/sandbox-tenki branch 2 times, most recently from 9730397 to 09c583e Compare July 15, 2026 18:39
@monoppa monoppa self-assigned this Jul 20, 2026
Comment thread website/docs/workspaces/sandbox.md
Comment thread packages/sandbox-tenki/src/sandbox.ts
Comment thread packages/sandbox-tenki/src/sandbox.ts
Comment thread packages/sandbox-tenki/src/sandbox.ts
Comment thread packages/sandbox-tenki/src/tools.ts Outdated
Comment thread packages/sandbox-tenki/src/sandbox.ts
Comment thread packages/sandbox-tenki/src/sandbox.ts
Comment thread packages/sandbox-tenki/vitest.config.ts
Comment thread website/docs/workspaces/sandbox.md Outdated
Comment thread packages/sandbox-tenki/src/sandbox.ts
@monoppa
monoppa force-pushed the feat/sandbox-tenki branch from ae84d01 to 3ae3e58 Compare July 24, 2026 12:23
@monoppa
monoppa requested a review from camcalaquian July 27, 2026 09:43
Comment thread packages/sandbox-tenki/package.json Outdated
Comment thread packages/sandbox-tenki/src/sandbox.ts Outdated
Comment thread packages/sandbox-tenki/src/sandbox.ts Outdated
Comment thread packages/sandbox-tenki/src/sandbox.ts Outdated
Comment thread packages/sandbox-tenki/src/sandbox.ts Outdated
Comment thread packages/sandbox-tenki/src/sandbox.ts Outdated
Comment thread packages/sandbox-tenki/README.md Outdated
@camcalaquian

Copy link
Copy Markdown

lgtm @monoppa let's submit a pr upstream

Add @voltagent/sandbox-tenki, a WorkspaceSandbox provider that runs each
execute_command inside a disposable Tenki Linux microVM via
@tenkicloud/sandbox, mirroring the existing E2B / Blaxel / Daytona providers.

TenkiSandbox is built on the SDK's session run() API, which returns a process
handle and is the only primitive that can enforce a per-command timeout and
AbortSignal. It forwards cwd/env/stdin natively, keeps stdout and stderr
separate, truncates each stream at maxOutputBytes on a UTF-8 character
boundary, and serializes start/stop/destroy so concurrent lifecycle calls
observe one transition at a time.

createTenkiToolkit adds optional expose_preview_url and authorize_ssh_key
tools, kept in tools.ts so consumers can omit them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@monoppa
monoppa force-pushed the feat/sandbox-tenki branch from 63a9e8b to 94889cb Compare July 30, 2026 09:29
@monoppa

monoppa commented Jul 30, 2026

Copy link
Copy Markdown
Owner Author

Superseded by the upstream PR: VoltAgent#1387

@monoppa monoppa closed this Jul 30, 2026
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