Skip to content

Harden sandbox API error handling and cut v0.1.0-beta.2#2

Merged
suarezesteban merged 1 commit into
mainfrom
fix/transport-resilience-beta2
Jun 6, 2026
Merged

Harden sandbox API error handling and cut v0.1.0-beta.2#2
suarezesteban merged 1 commit into
mainfrom
fix/transport-resilience-beta2

Conversation

@suarezesteban

Copy link
Copy Markdown
Collaborator

Improves resilience and diagnosability when the Sandbox API returns an unexpected response (seen in the wild as an opaque "Expected a stream of command data" on a stock create-next-app, traced to a transport-layer response, not the user's app).

Changes

  • Surface real errors: error formatting now includes HTTP status, an unexpected content-type, and a response-body snippet, so transport failures (proxies, gateways, rate limits) are diagnosable.
  • Targeted retry: idempotent boot commands and stop()/snapshot retry transport-level failures (dropped stream, 408/429/5xx, malformed response) via an opt-in retryTransport flag plus a stop() poll fallback. Non-idempotent spawns are untouched.
  • De-noise: a failed-startup snapshot error that shares the transport cause shows as a dim aside instead of a second alarming line above the root error.
  • SDK bump: @vercel/sandbox 2.0.1 to 2.1.1 (its required undici floor is exempted from the release-age gate).
  • Release: adds v0.1.0-beta.2 artifacts and bumps the installer default.

Verification

  • lint / typecheck / test (145) / build green; bundle 620 KB.
  • Live: up . on a stock create-next-app boots and serves; up stop snapshots; up . resumes from the snapshot. No transport error.
  • SDK 2.1.1 error shapes confirmed unchanged, so the retry detector and error formatting still apply.

Surface HTTP status, content-type, and response body on SDK errors so
transport failures (proxies, gateways, rate limits) are diagnosable
instead of opaque, e.g. "Expected a stream of command data".

Retry transport-level failures on idempotent boot commands and on
stop/snapshot, via an opt-in retryTransport flag plus a stop() poll
fallback, so a mangled or dropped response self-heals instead of
aborting the run.

Keep a failed-startup snapshot error as a dim aside when it shares the
transport cause, instead of a second alarming line above the root error.

Bump @vercel/sandbox 2.0.1 to 2.1.1 (its required undici floor is exempt
from the release-age gate), and add the v0.1.0-beta.2 release artifacts.
@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
upcli Ready Ready Preview, Comment Jun 6, 2026 3:02am
upcli-downloads Ready Ready Preview, Comment Jun 6, 2026 3:02am

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​vercel/​sandbox@​2.1.17410010099100

View full report

@suarezesteban suarezesteban merged commit aa6dfef into main Jun 6, 2026
9 checks passed
@suarezesteban suarezesteban deleted the fix/transport-resilience-beta2 branch June 6, 2026 03:06
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