feat(ai-sandbox-upstash-box): add Upstash Box sandbox provider - #899
feat(ai-sandbox-upstash-box): add Upstash Box sandbox provider#899alitariksahin wants to merge 1 commit into
Conversation
Add @tanstack/ai-sandbox-upstash-box, a provider that runs harness adapters inside isolated Upstash Box cloud sandboxes through the uniform SandboxHandle: - fs via Box's native file API (read/write/list) + shell for mkdir/remove/ rename/exists; paths normalized between the virtual /workspace root and Box's /workspace/home session home - exec/spawn shell-wrap cwd + env (exports before `cd` so a failed cd is &&-gated); spawn streams stdout over exec.stream with abort-driven kill() - ports.connect via getPublicURL (bearer/basic auth -> channel headers) - native snapshots (box.snapshot / Box.fromSnapshot) and restoreSnapshot - backgroundProcesses: true / writableStdin: false (Daytona parity); fork unsupported Includes unit tests (mocked Box) and gated integration tests (UPSTASH_BOX_API_KEY), README, changeset, and the central provider-list row.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
@alitariksahin this is in draft, is this still relevant? |
|
@alitariksahin would you mind pushing this over the finish line so we can get it merged? |
|
@AlemTuzlak I will give it a final check, and get the sdk up to date today. |
Closes #898
What
Adds
@tanstack/ai-sandbox-upstash-box, a sandbox provider that runs harness adapters inside isolated Upstash Box cloud sandboxes through the uniformSandboxHandle— alongside Docker / Daytona / Vercel / Cloudflare / Sprites.How
Built on the Daytona provider as the closest reference:
exec) for mkdir/remove/rename/exists. Virtual/workspace↔ Box/workspace/home(Box.WORKSPACE) path mapping;list()returns paths in the caller's virtual namespace.cdso a failedcd(&&-gated) doesn't run the command.spawn()streams stdout overexec.stream;wait()resolves on the exit chunk;kill()aborts via anAbortControllerthat unblocks a silent stream.writableStdin: false(Daytona parity).getPublicURL, mapping bearer/basic auth to channel headers.box.snapshot()/Box.fromSnapshot(), plusprovider.restoreSnapshot().backgroundProcesses: true,snapshots: true,durableFilesystem: true;writableStdin/networkPolicy/forkfalse. Best-effortsignal.throwIfAborted()pre-flight on create/resume/restoreSnapshot/destroy/exec/spawn (the Box SDK can't cancel in-flight calls).Also updates the central provider-list table in
@tanstack/ai-sandbox's README and adds a changeset.Test plan
pnpm --filter @tanstack/ai-sandbox-upstash-box test:types— ✅pnpm --filter @tanstack/ai-sandbox-upstash-box test:eslint— ✅pnpm --filter @tanstack/ai-sandbox-upstash-box test:build(publint) — ✅pnpm --filter @tanstack/ai-sandbox-upstash-box build— ✅pnpm --filter @tanstack/ai-sandbox-upstash-box test:lib— ✅ 18 testskill(), public-URL mapping, capability flags).describe.skipIf(!UPSTASH_BOX_API_KEY)) run against live Upstash Box: create → exec → text/binary fs round-trip → streamed spawn → destroy, and snapshot →restoreSnapshot→ verify file survives.pnpm test:sherif/pnpm test:knip— ✅Sandbox providers aren't part of the E2E harness matrix (
testing/e2e/feature-support.tscovers chat/streaming adapters); this follows the Daytona/Docker/Vercel convention of gated integration tests in the package's owntests/.Draft / blocked on
Opened as a draft because
pnpm-lock.yamlstill needs the@upstash/boxentry. The lockfile couldn't be regenerated in my dev environment (registry/CDN metadata issues unrelated to this change). Will push the lockfile update to make CI green before marking ready for review.