Vercel sandbox

From getsentry/junior · View interactive version

Vercel sandbox is an AI agent skill from the GitHub repository getsentry/junior. Investigate Vercel Sandbox lifecycle, timeout, snapshot, and persistence behavior. Use when users ask about Vercel Sandbox, `@vercel/sandbox`, `Sandbox.create`, `Sandbox.get`, why files disappeared, how snapshots differ from persistence, or whether Vercel's persistent sandbox beta applies.

How to use this skill

Skill file

Investigate Vercel Sandbox using current official docs, installed SDK contracts, and only then any consumer-specific integration code.

Step 1: Classify the request

Pick the narrowest reference set before answering:

| Request type | Read first |

| ----------------------------------------------------------------------------- | ------------------------------------------- |

| SDK/API behavior, lifecycle semantics, snapshots, stable vs beta persistence | references/api-surface.md |

| Product-level usage patterns and architectural choices | references/common-use-cases.md |

| Broken behavior, confusing docs, missing files, or suspected persistence bugs | references/troubleshooting-workarounds.md |

If the task spans categories, load only the relevant files above.

Step 2: Establish which sandbox model applies

  1. Inspect the installed @vercel/sandbox version and local types before trusting any doc page or changelog.
  2. If local types only expose sandboxId, Sandbox.get({ sandboxId }), extendTimeout, and snapshot-backed source, treat the runtime as stable 1.x ephemeral sandboxes.
  3. If local code and types expose named sandboxes, name, persistent, session updates, or automatic resume after stop, treat the runtime as the persistent beta model.
  4. Qualify time-sensitive claims with a date or retrieval note.

Step 3: Apply core guardrails

  1. Distinguish three separate clocks before diagnosing workspace loss:
  1. On stable 1.x, Sandbox.get({ sandboxId }) only helps while the sandbox is still alive.
  2. On stable 1.x, once the sandbox stops, its filesystem is gone. Do not describe that as resumable persistence.
  3. sandbox.snapshot() is not workspace durability. It creates a new snapshot artifact and stops the source sandbox.
  4. Snapshots and persistent beta solve different problems:
  1. In embedded systems, inspect the consumer's persistence wiring before concluding that Vercel destroyed the workspace immediately.
  2. Do not infer persistent-beta behavior from a changelog alone. Confirm the installed SDK and local call sites.

Step 4: Investigate the Vercel surface first

  1. Check the installed SDK surface first:
  1. Determine whether the question is about:
  1. Establish which timeout fired first and whether the sandbox should still have been active.

Step 5: Inspect consumer code only when the task is app-specific

For repo-local debugging in Junior, inspect:

  1. timeout budget alignment:
  1. sandbox identity persistence and reuse:
  1. whether timeout paths actually resume:
  1. where sandbox metadata is persisted:
  1. whether consumer-specific snapshots are being confused with Vercel product persistence:

Step 6: Recommend the smallest correct fix

Choose the narrowest fix that matches the diagnosed failure mode:

  1. Sandbox still alive but next turn started fresh:
  1. Sandbox actually stopped:
  1. Confusion caused by docs drift:
  1. Need true durability across stop/timeout boundaries:

Step 7: Return a concrete diagnosis

Default report structure:

  1. Active sandbox model: stable-ephemeral or persistent-beta
  2. What likely timed out first
  3. Whether the sandbox probably still existed after the failed turn
  4. Whether workspace loss came from Vercel stop/destruction or consumer state handling
  5. Smallest next fix, with the exact file(s) or SDK change required
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.