Skip to content

promote: test → main (@vercel/sandbox v2 bump)#504

Merged
sweetmantech merged 1 commit intomainfrom
test
May 2, 2026
Merged

promote: test → main (@vercel/sandbox v2 bump)#504
sweetmantech merged 1 commit intomainfrom
test

Conversation

@sweetmantech
Copy link
Copy Markdown
Contributor

@sweetmantech sweetmantech commented May 2, 2026

Promotes #503 (@vercel/sandbox 1.3.1 → 2.0.0-beta.11) from `test` to `main`.

Contents

Verification

PR #503 was manually verified end-to-end on its preview deployment — see #503 (comment) for full results: real Vercel Sandbox created via POST /api/sandboxes, listed via GET, all v1→v2 SDK surface changes round-trip correctly.

Why this lands as part of the migration

Phase 2 prerequisite — open-agents' `packages/sandbox` is built on @vercel/sandbox v2; api needed to be on v2 first before the upcoming code-merge PR can absorb open-agents' sandbox runtime into `api/lib/sandbox/`.


Summary by cubic

Promotes the @vercel/sandbox v2 upgrade from test to main. Updates our sandbox integration to the v2 API while keeping public responses unchanged and preparing for the open-agents sandbox merge.

  • Dependencies

    • Bumped @vercel/sandbox to 2.0.0-beta.11.
  • Migration

    • Switched SDK usage from sandboxId to name, and Sandbox.get({ sandboxId }) to Sandbox.get({ name }).
    • Kept sandboxId in our HTTP responses and trigger payloads; translate to name at the lib boundary.
    • Updated tests to mock name and assert Sandbox.get({ name }).

Written for commit 6e4242b. Summary will update on new commits.

Summary by CodeRabbit

  • Bug Fixes
    • Updated sandbox identification logic to ensure consistent and correct property references across all sandbox operations, including creation, retrieval, and status checking.

Phase 2 prerequisite. Aligns api with the version open-agents uses, so a
later PR can absorb open-agents' packages/sandbox into api/lib/sandbox/
without a dep mismatch.

The v1 -> v2 API change relevant to api: Sandbox.sandboxId is renamed
to Sandbox.name, and Sandbox.get's params likewise take { name } instead
of { sandboxId }. api's internal vocabulary keeps "sandboxId" — it's in
the public HTTP response shape (SandboxCreatedResponse, the JSDoc on
app/api/sandboxes/route.ts) and in lib/trigger/triggerPromptSandbox's
own argument schema. The translation only happens at the v2 boundary
inside lib/sandbox/:

  sandbox.sandboxId           -> sandbox.name
  Sandbox.get({ sandboxId })  -> Sandbox.get({ name })
  Sandbox["sandboxId"] type   -> Sandbox["name"]

10 production-code edits across 6 files; tests updated to mock Sandbox
objects with `name` and to assert `Sandbox.get({ name })`.

Verification:
  - pnpm install: clean
  - pnpm exec tsc --noEmit: clean for lib/sandbox/ (preexisting unrelated
    type errors elsewhere left untouched, since the api repo's CI runs
    eslint not tsc)
  - pnpm lint:check: clean
  - pnpm test lib/sandbox: 152/152 pass
  - pnpm test (full): 2362/2362 pass

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api Ready Ready Preview May 2, 2026 11:11pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 29e5f4de-85e1-4c83-815b-35dad189d738

📥 Commits

Reviewing files that changed from the base of the PR and between c9c4065 and 6e4242b.

⛔ Files ignored due to path filters (8)
  • lib/sandbox/__tests__/createSandbox.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/createSandboxFromSnapshot.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/getActiveSandbox.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/getOrCreateSandbox.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/getSandboxStatus.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/processCreateSandbox.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • package.json is excluded by none and included by none
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by none
📒 Files selected for processing (6)
  • lib/sandbox/createSandbox.ts
  • lib/sandbox/createSandboxFromSnapshot.ts
  • lib/sandbox/getActiveSandbox.ts
  • lib/sandbox/getOrCreateSandbox.ts
  • lib/sandbox/getSandboxStatus.ts
  • lib/sandbox/processCreateSandbox.ts

📝 Walkthrough

Walkthrough

The PR updates sandbox identity handling across six sandbox utility functions to source sandbox IDs from the name property instead of the sandboxId property, affecting both Vercel API calls and response mappings.

Changes

Sandbox Identity Migration

Layer / File(s) Summary
Type Contract
lib/sandbox/createSandbox.ts
SandboxCreatedResponse.sandboxId type updated to reference Sandbox["name"] instead of Sandbox["sandboxId"].
Vercel API Integration
lib/sandbox/getActiveSandbox.ts, lib/sandbox/getSandboxStatus.ts
Sandbox.get() calls updated to use { name: ... } argument instead of { sandboxId: ... }.
Result Mapping & Storage
lib/sandbox/createSandbox.ts, lib/sandbox/createSandboxFromSnapshot.ts, lib/sandbox/getOrCreateSandbox.ts, lib/sandbox/processCreateSandbox.ts
Response fields and database recordings now source sandbox IDs from sandbox.name rather than sandbox.sandboxId across creation, retrieval, and status-query flows.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🏗️ A sandbox by any other name would run as sweet,
No more sandboxId debates—one source of truth to meet!
Through every function, Sandbox.name now leads the way,
Clean identity contracts brighten the refactored day. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Solid & Clean Code ⚠️ Warning Three files exhibit identical response object construction patterns with the same field mappings and toISOString() transformation, violating the DRY principle and indicating a need for shared utility extraction. Refactor the repeated response object construction logic from createSandbox.ts, getSandboxStatus.ts, and processCreateSandbox.ts into a dedicated utility function to improve maintainability and adherence to SOLID principles.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test

Tip

💬 Introducing Slack Agent: Turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value).


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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@sweetmantech sweetmantech merged commit 55f6b3b into main May 2, 2026
6 of 7 checks passed
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.

1 participant