feat(sandbox-tenki): add Tenki sandbox provider
PR Checklist
- The commit message follows our guidelines: https://voltagent.dev/docs/community/contributing/#commit-convention
Bugs / Features
- Related issue(s) linked
- Tests for the changes have been added
- Docs have been added / updated
- Changesets have been added https://voltagent.dev/docs/community/contributing/#creating-a-changeset
What is the current behavior?
VoltAgent ships first-party workspace sandbox providers for Blaxel, Daytona, and E2B. There is none for Tenki, so anyone who wants agents to run shell commands in Tenki microVMs has to implement WorkspaceSandbox themselves.
What is the new behavior?
Adds @voltagent/sandbox-tenki, a WorkspaceSandbox implementation backed by @tenkicloud/sandbox, mirroring the existing E2B / Blaxel / Daytona providers. Each TenkiSandbox lazily provisions one disposable Tenki Linux microVM and reuses it across every execute_command:
- streaming stdout/stderr, with
maxOutputBytestruncation on UTF-8 codepoint boundaries - per-call
timeoutMsandAbortSignal, enforced by killing the remote process - native
cwd/env/stdinforwarding start()/stop()/destroy()with serialized lifecycle transitions; a paused session is resumed (and timeout/abort re-checked) before a command runsgetSandbox()for direct SDK access (filesystem, port exposure, SSH), plusgetInfo()/getInstructions()for the workspace toolkitcreateTenkiToolkit(sandbox)— optionalexpose_preview_urlandauthorize_ssh_keytools on the same session, isolated intools.tsso they can be dropped without touching the adapter
No changes to @voltagent/core. Also included: a package README, a ### Tenki section plus provider-table row in website/docs/workspaces/sandbox.md, and a minor changeset.
Notes for reviewers
-
Disclosure: I work with Tenki team.
-
CI: no sandbox provider is currently in the
test-packagesmatrix, so this suite (likesandbox-blaxel's) will not run upstream. I deliberately left the workflow files untouched — addingsandbox-tenkitorelease.ymlwould make it a gate onpublish, which isn't my call. Glad to add all four providers to the matrix in a follow-up if you'd like them there. -
E2E Testsruns rather than skips on this PR because its path filter matchespnpm-lock.yaml. Nothing here touches an e2e input. -
Validation: 133 tests, 100% line/branch/function/statement coverage (SDK fully mocked — no network, no credentials), plus
pnpm install --frozen-lockfile,pnpm lint:ci,pnpm sp lint,pnpm build:all,pnpm publint:all,typecheck, andcommitlint. No live microVM run — there is noTENKI_API_KEYin this environment.
Summary by cubic
Add @voltagent/sandbox-tenki, a new sandbox provider that runs agent commands in disposable Tenki Linux microVMs via @tenkicloud/sandbox. Adds Tenki alongside E2B, Blaxel, and Daytona, with lifecycle and output handling tuned for reliability.
-
New Features
- Implements
WorkspaceSandboxwith one lazily provisioned Tenki session reused across commands; serializedstart/stop/destroywith a bounded resume timeout. - Streams stdout/stderr with UTF‑8–safe truncation (
maxOutputBytes), per‑calltimeoutMsandAbortSignal, and nativecwd/env/stdinforwarding. - Escape hatch via
getSandbox()and workspace metadata; optionalcreateTenkiToolkit()withexpose_preview_urlandauthorize_ssh_key(validates a single‑lineauthorized_keysentry).
- Implements
-
Bug Fixes
- Prevent lifecycle stalls by releasing the queue when a canceled execute abandons
resume(). - Prefer the run’s aggregate output if a stream pump dies and propagate truncation flags; collapse CR/LF in Tenki “reason” to a single‑line diagnostic.
- Docs: add Tenki to the sandbox guide and note
TENKI_AUTH_TOKENas an alternative credential.
- Prevent lifecycle stalls by releasing the queue when a canceled execute abandons
Summary by CodeRabbit
-
New Features
- Added Tenki as a remote workspace sandbox provider using disposable Linux microVMs.
- Supports streamed output, timeouts, cancellation, environment and directory settings, input forwarding, and output limits.
- Added lifecycle controls, preview URL exposure, SSH key authorization, and direct session access.
- Added the
@voltagent/sandbox-tenkipackage and optional preview URL and SSH tools.
-
Documentation
- Added setup guidance, configuration examples, credential handling, workspace selection, and cleanup recommendations for Tenki sandboxes.