Add Tenki Sandbox as a cloud provider (#4)#244
Open
francoluxor wants to merge 1 commit into
Open
Conversation
* Add Tenki Sandbox as a cloud provider
Adds `--provider tenki`: each box runs in a Tenki (tenki.cloud) Firecracker
microVM driven over the official @tenkicloud/sandbox TypeScript SDK — a
ConnectRPC control plane plus a per-session data plane for exec/file transfer,
and session.ssh() for interactive attach.
New packages/sandbox-tenki implements the CloudBackend contract and exports a
uniform providerModule (provider/backend/ensureCredentials/readCredStatus/
currentBaseFingerprintLive/doctorChecks). Tenki is registered in the PROVIDERS
single-source-of-truth table and both provider IMPORTERS maps (CLI + hub);
config keys (box.imageTenki / sizeTenki / defaultCheckpointTenki /
tenkiTimeoutMs), schema, and docs follow the existing cloud-provider pattern.
Validated end-to-end against a live Tenki workspace: provision, exec, file
seed (workdir-bridged for /tmp + /workspace), download round-trip, preview +
signed preview URLs, pause/resume, keepalive extend, snapshots, and destroy.
* Address review on the Tenki provider
- Drop the duplicate manual KEY_REGISTRY entries for box.defaultCheckpointTenki
/ sizeTenki / imageTenki (the perProvider*Keys() generators already emit them
from the PROVIDERS table); add a KEY_REGISTRY uniqueness guard and fix the
tenki sizeDesc to match actual create-time sizing.
- Add setCredentials to the tenki providerModule so the hub credential form
works (was a dead end); delegate persistence to the shared writeManagedSecrets
instead of a private copy.
- Docs: drop the duplicate box.tenkiTimeoutMs row (kept under provider tuning)
and fix the tenki-backlog link to point at the file.
* Address second review pass on the Tenki provider
- Wire create-time sizing: `--size` / `box.sizeTenki` (a `cpu-memory[-disk]` GB
spec) now parses via parseTenkiSize and overrides the box's create resources
(Tenki applies cpuCores/memoryMb/diskSizeGb at createAndWait), so the flag
actually changes the box; invalid specs fall back to defaults with a log.
Fix the box.sizeTenki description to match and add unit tests.
- Drop the stale `box.tenkiTimeoutMs` "Deferred" item from tenki-backlog.md
(the key is fully implemented).
Not applied: recordBox('paused') after checkpoint — Tenki's createSnapshotAndWait
takes a live snapshot and leaves the source RUNNING (verified against a live
workspace), so marking the box paused would be incorrect.
* Prevent orphaned Tenki sessions on provision timeout
provision used createAndWait, which throws without surfacing the session id
on a readiness timeout — a VM that provisioned but never became ready would
leak (its id lost, no retry). Split create from wait: create({ waitReady:
false }) returns the id as soon as the session exists, then wait separately;
if the wait times out or the boot fails, terminate the box (we still hold the
id) before surfacing the error. No idempotency key / AbortController: the SDK
exposes neither on create, and provision already never retries.
|
@francoluxor is attempting to deploy a commit to the madarco's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for your pull request. Before it can be merged, please read our Contributor License Agreement and sign it by posting the comment below. You only ever have to do this once. I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
francoluxor
marked this pull request as ready for review
July 22, 2026 14:36
Owner
|
Thanks, but the official method to add a provider is through a plugin: https://agent-box.sh/docs/build-a-provider |
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.
What this changes
Add Tenki Sandbox as a cloud provider
Adds
--provider tenki: each box runs in a Tenki (tenki.cloud) Firecracker microVM driven over the official @tenkicloud/sandbox TypeScript SDK — a ConnectRPC control plane plus a per-session data plane for exec/file transfer, and session.ssh() for interactive attach.How it was tested
Full workspace gate — all green:
Unit tests (@agentbox/sandbox-tenki): state mapping (incl. USER_SHUTDOWN), retry classification (ConnectRPC + socket codes), preview-slug/name helpers, env parsing, isUnderWorkdir boundary cases, and parseTenkiSize.
@agentbox/config includes the providers/schema drift tests, so the PROVIDERS table ↔ ProviderKind/KEY_REGISTRY/JSON-schema stay consistent, plus a KEY_REGISTRY duplicate-key guard.
Live end-to-end against a real Tenki workspace (api.tenki.cloud), driving the built provider (tenkiBackend) directly — one session at a time, self-cleaned, 0 leaked sessions/snapshots afterward.
Checklist
pnpm lint && pnpm build && pnpm typecheck && pnpm testpassesapps/web/content/docs/)