vercel-labs/sandbox-lifecycle-debug
Sandbox lifecycle debugging for vercel-openclaw: create, resume, stop, snapshotting, reset, stale-running reconciliation, persistent Sandbox v2 behavior, hot spares, and lifecycle locks. Use when sandbox state transitions, status polling, stop/resume, reset, or lifecycle recovery is wrong.
npx skills add https://github.com/vercel-labs/vercel-openclaw --skill 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.
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..git rev-parse HEAD, remote git ls-remote origin main, and live deployment proof.Report these separately:
SingleMeta.statusDo not use running as shorthand for gateway-ready or user-ready.
/api/admin/ensure -> ensureSandboxRunning() / ensureSandboxReady().ensureSandboxRunning() -> token refresh -> touchRunningSandbox() -> proxy.stopSandbox() -> cleanup -> cron persistence -> sandbox.stop({ blocking: false }) -> snapshotting host metadata while v2 persists state.GET /api/status -> stale running or snapshotting reconciliation.resetSandbox() destroys active sandbox and snapshots, clears cron and token metadata.snapshotId.resume:false.snapshot() is explicit/debug/checkpoint only and shuts the sandbox down.persistent:false.src/server/sandbox/lifecycle.ts, src/server/sandbox/controller.ts.src/app/api/admin/{ensure,stop,snapshot,reset,status}/** and src/app/api/status/route.ts.src/server/sandbox/**.test.ts and src/test-utils/harness.lat.md/sandbox-lifecycle.md, docs/lifecycle-and-restore.md.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.
Take vercel-labs/sandbox-lifecycle-debug from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.