Skip to content

Add support for image= to unstable.sandbox#151

Open
scotttrinh wants to merge 1 commit into
mainfrom
unstable/sandbox-image
Open

Add support for image= to unstable.sandbox#151
scotttrinh wants to merge 1 commit into
mainfrom
unstable/sandbox-image

Conversation

@scotttrinh

Copy link
Copy Markdown
Collaborator

Matching unstable.sandbox PR for #147

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
vercel-py Ready Ready Preview Jun 30, 2026 2:20pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an image parameter to the (unstable) sandbox creation flow so callers can create a sandbox from a Vercel Container Registry image, with validation to prevent specifying both runtime and image.

Changes:

  • Extend create_sandbox(...) (async + sync) and internal service/client layers to accept and forward image.
  • Enforce runtime/image mutual exclusivity via a Pydantic model validator.
  • Add tests ensuring image is serialized correctly (and runtime is omitted) and that using both is rejected.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unstable/test_sandbox_public_flow.py Adds coverage for image serialization and runtime+image validation behavior.
src/vercel/unstable/sandbox/sync.py Adds image to the sync public wrapper and updates docstring.
src/vercel/unstable/sandbox/init.py Adds image to the async public wrapper and updates docstring.
src/vercel/_internal/unstable/sandbox/sync_runtime.py Threads image through the sync runtime creation path.
src/vercel/_internal/unstable/sandbox/service.py Threads image through the service layer into the API client.
src/vercel/_internal/unstable/sandbox/async_runtime.py Threads image through async operation params and execution.
src/vercel/_internal/unstable/sandbox/api_client.py Adds request field + runtime/image mutual-exclusion validation and forwards image in request creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/vercel/unstable/sandbox/__init__.py
@scotttrinh scotttrinh force-pushed the unstable/persistent-sandbox branch from fa3d4d6 to c690787 Compare June 29, 2026 20:48
@scotttrinh scotttrinh force-pushed the unstable/sandbox-image branch from c121768 to 87975c7 Compare June 29, 2026 20:59
@scotttrinh scotttrinh changed the base branch from unstable/persistent-sandbox to main June 29, 2026 21:00
@scotttrinh scotttrinh changed the title Add support for image= to sandbox.create(...) Add support for image= to unstable.sandbox Jun 29, 2026
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.

2 participants