sandbox-lifecycle-debug

작성자: vercel

Sandbox 라이프사이클 디버깅: 생성, 재개, 중지, 스냅샷, 리셋, 오래된 실행 조정, 지속적 Sandbox v2 동작, 핫…

npx skills add https://github.com/vercel-labs/vercel-openclaw --skill sandbox-lifecycle-debug

Sandbox Lifecycle Debug

Use this skill when the sandbox state machine is the primary suspect.

For Sandbox v2 truth-model work, also load sandbox-v2-lifecycle. Official Vercel Sandbox v2 docs override older repo guidance that treats manual snapshots as the normal restore source.

Start Here

Read lat.md/sandbox-lifecycle.md sections Status State Machine, Triggers -- What Causes State Transitions, and the specific trigger involved. Run lat locate "Sandbox Lifecycle" or lat search "sandbox lifecycle <symptom>" when unsure.

Collect before edits:

  • GET /api/status and any UI state that triggered the action.
  • GET /api/admin/sandbox-diag.
  • GET /api/admin/logs filtered for sandbox., gateway., watchdog., proxy..
  • Local git rev-parse HEAD, remote git ls-remote origin main, and live deployment proof.

Split The State

Report these separately:

  • metadata status in SingleMeta.status
  • Vercel Sandbox SDK status
  • gateway readiness on port 3000
  • persistent auto-saved state availability
  • manual snapshot/checkpoint availability when relevant
  • lifecycle lock and start lock state when visible
  • UI polling status

Do not use running as shorthand for gateway-ready or user-ready.

Common Paths

  • Admin ensure: /api/admin/ensure -> ensureSandboxRunning() / ensureSandboxReady().
  • Gateway request: auth -> ensureSandboxRunning() -> token refresh -> touchRunningSandbox() -> proxy.
  • Stop/auto-save: stopSandbox() -> cleanup -> cron persistence -> sandbox.stop({ blocking: false }) -> snapshotting host metadata while v2 persists state.
  • Status polling: GET /api/status -> stale running or snapshotting reconciliation.
  • Reset: resetSandbox() destroys active sandbox and snapshots, clears cron and token metadata.

Sandbox v2 Rules

  • Main OpenClaw sandbox is one named persistent sandbox.
  • Normal resume uses the persistent name and auto-saved state, not manual snapshotId.
  • Observation of stopped/snapshotting state must use resume:false.
  • Manual snapshot() is explicit/debug/checkpoint only and shuts the sandbox down.
  • Worker/debug sandboxes are short-lived and must use persistent:false.

Fix Boundaries

  • Primary: src/server/sandbox/lifecycle.ts, src/server/sandbox/controller.ts.
  • Routes: src/app/api/admin/{ensure,stop,snapshot,reset,status}/** and src/app/api/status/route.ts.
  • Tests: lifecycle and harness tests under src/server/sandbox/**.test.ts and src/test-utils/harness.
  • Docs: lat.md/sandbox-lifecycle.md, docs/lifecycle-and-restore.md.

Verification

Use the narrowest command that covers the path, then run the repo verifier when the change has broad lifecycle impact:

node scripts/verify.mjs --steps=test,typecheck
lat check

For live lifecycle incidents, include before/after /api/status, /api/admin/sandbox-diag, and relevant log events.

vercel의 다른 스킬

benchmark-sandbox
vercel
Vercel Sandbox에서 vercel-plugin eval 시나리오를 로컬 WezTerm 패널 대신 실행합니다. Claude Code와 플러그인이 사전 설치된 임시 마이크로VM을 프로비저닝합니다.
official
emil-design-eng
vercel
이 스킬은 Emil Kowalski의 UI 폴리시, 컴포넌트 디자인, 애니메이션 결정, 그리고 소프트웨어를 훌륭하게 만드는 보이지 않는 세부 사항에 대한 철학을 인코딩합니다.
official
vercel-react-best-practices
vercel
Vercel Engineering의 React 및 Next.js 성능 최적화 가이드라인입니다. 이 스킬은 React/Next.js 코드를 작성, 검토 또는 리팩토링할 때 사용해야 합니다.
official
vercel-react-best-practices
vercel
Vercel Engineering의 React 및 Next.js 성능 최적화 가이드라인입니다. 이 스킬은 React/Next.js 코드를 작성, 검토 또는 리팩토링할 때 사용해야 합니다.
official
write-guide
vercel
점진적인 예제를 통해 실제 사용 사례를 가르치는 기술 가이드를 제작합니다. 개념은 독자가 필요로 할 때만 소개됩니다.
official
release
vercel
Vercel-plugin 릴리스 — 게이트 실행, 버전 업, 아티팩트 생성, 커밋 및 푸시. "릴리스", "배포", "버전 업 및 푸시", "릴리스 생성" 요청 시 사용.
official
deepsec
vercel
dev3000에서 체크아웃한 Vercel 프로젝트에 대해 DeepSec을 실행합니다. 원클릭 DeepSec 설정, 프로젝트 컨텍스트 부트스트래핑, 제한된 1차 처리 등에 사용합니다.
official
backport-pr
vercel
병합된 Next.js 풀 리퀘스트를 canary에서 next-16-2와 같은 이전 릴리스 브랜치로 백포트합니다. 사용자가 백포트, 체리픽 또는 열기를 요청할 때 사용합니다…
official