feat(sandbox-vercel): Vercel Sandbox provider worker#95
Conversation
Mirrors the sandbox::e2b::* ABI under sandbox::vercel::* with capability negotiation, per-worker concurrency tracking, and S-code error mapping. Same 8 functions (create, exec, stop, list, snapshot, expose_port, fs::read, fs::write). Auth: prefers VERCEL_OIDC_TOKEN; falls back to VERCEL_TOKEN + VERCEL_TEAM_ID + VERCEL_PROJECT_ID. Default base URL: https://api.vercel.com. Default runtime: node24. 5/5 vitest tests pass; biome lint clean; tsc clean. HTTP call bodies stubbed pending verified pass against Vercel's REST surface.
Re-orders type and value imports per biome's organizeImports check so 'biome ci .' passes cleanly. No behavior change.
Replaces stubs with the surface verified at vercel.com/docs/rest-api/sandboxes
via context7:
- create: POST /v1/sandboxes?teamId=&slug= body {runtime, source, timeout}
- timeout is in MILLISECONDS (Vercel contract); converted from
idle_timeout_secs at the boundary
- source is required (git ref); caller passes optional source_url +
source_revision in the payload
- exec: POST /v1/sandboxes/{id}/commands body {command, args, cwd}
- stop: POST /v1/sandboxes/{id}/stop (POST not DELETE)
- 404 and 409 treated as idempotent success
- list: GET /v1/sandboxes?teamId=&slug= response {sandboxes:[...]} or array
teamId from VERCEL_TEAM_ID; slug from VERCEL_TEAM_SLUG. Bearer token
from VERCEL_OIDC_TOKEN with VERCEL_TOKEN fallback. SandboxRecord
started_at is now a pass-through string to match the rest of the family.
snapshot, expose_port, and fs ops remain stubbed pending v2-beta
sessions surface. Adds .gitignore for node_modules + .venv +
package-lock.json. tsc + biome + tests clean.
registerFunction(id, async (input) => ...) handler signature unchanged between versions; tsc + biome + vitest still clean.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✨ 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 |
Stops shadowing the bare sandbox::* namespace. Routes through the sandbox router worker (provider="vercel"); direct invocation stays supported and stable. Handler logic, tests, S-code mapping unchanged.
|
Refactored to register only Validation: |
Member of the sandbox worker family. Read `sandbox-CONTEXT.md` (lands via #92) for family terminology and ABI contract.
What ships
`sandbox-vercel/` — narrow Node iii worker wrapping Vercel Sandbox (Firecracker microVMs on Vercel's "Hive" infra).
Functions
REST endpoint paths verified via context7 against `vercel.com/docs/rest-api/sandboxes/*`:
Capabilities advertised: `["snapshot","expose_port","fs"]`.
Auth model
Worker fails fast at startup if neither credential path is satisfied.
Vercel asymmetry (documented in CONTEXT.md)
Vercel's `image` field is meaningless without `source` (a git ref to clone) + `runtime` (`node24`/`python3.13`). Caller passes `source_url` and optional `source_revision` in the create payload; the canonical `image` field is informational on Vercel.
Tests
5 vitest cases against handler boundary (allowlist, in_flight rollback, exec validation, stop error mapping, list envelope). `tsc --noEmit` clean, biome ci clean.
Live test status
Wired against documented shapes; not yet end-to-end verified.
Pin
`iii-sdk: 0.11.6`.