Summary
user_vercel_project sandbox billing (BYO Vercel compute) is shelved but half-buried, and its auth foundation is broken. We want to keep the idea (bring your own compute is a good PAYG story) but it is not happening yet — so the codebase should stop pretending it might turn on, and the one live path that shares its broken auth needs a fix.
Current state (verified Aug 4)
- Mode is shelved by design. #597 hid the BYO-Vercel UI and gated
user_vercel_project behind NEXT_PUBLIC_SANDBOX_DISABLE_USER_BILLING; #598/#599 finished the flag mechanics.
- It cannot work even if the flag flips. Launch would authenticate
Sandbox.create() with the user's stored OAuth token (getOAuthToken(userId, "vercel")), but our Vercel OAuth flow requests only identity scopes — openid email profile offline_access (app/api/auth/vercel/route.ts:42). That token has no Vercel API access and cannot create sandboxes on the user's project/team. Un-gating the mode today would just produce auth failures at launch.
- Live collateral bug:
lib/vercel/env-vars.ts uses the same identity-scoped token for REST calls to pull env vars from a user's linked Vercel project (getUserVercelToken → Bearer header). If env sync from Vercel projects is supposed to work, it is likely failing silently behind warnAndReturnFallback. Grep prod logs for the env-sync warning prefix to confirm.
- Dead plumbing spans ~6 files:
lib/sandbox/billing.ts (mode resolution), lib/vercel/target-resolution.ts, lib/vercel/reconciliation.ts, lib/vercel/reconcile-links-runner.ts, lib/vercel/validation.ts, plus branches in lib/sandbox/reaper.ts, summary.ts, debug-presenter.ts, readiness-reconciliation.ts.
Proposed fix (keep the door, remove the theater)
Non-goals
Building BYO compute now. This issue is cleanup + the env-sync auth fix + preserving an honest path to do it later.
Summary
user_vercel_projectsandbox billing (BYO Vercel compute) is shelved but half-buried, and its auth foundation is broken. We want to keep the idea (bring your own compute is a good PAYG story) but it is not happening yet — so the codebase should stop pretending it might turn on, and the one live path that shares its broken auth needs a fix.Current state (verified Aug 4)
user_vercel_projectbehindNEXT_PUBLIC_SANDBOX_DISABLE_USER_BILLING; #598/#599 finished the flag mechanics.Sandbox.create()with the user's stored OAuth token (getOAuthToken(userId, "vercel")), but our Vercel OAuth flow requests only identity scopes —openid email profile offline_access(app/api/auth/vercel/route.ts:42). That token has no Vercel API access and cannot create sandboxes on the user's project/team. Un-gating the mode today would just produce auth failures at launch.lib/vercel/env-vars.tsuses the same identity-scoped token for REST calls to pull env vars from a user's linked Vercel project (getUserVercelToken→Bearerheader). If env sync from Vercel projects is supposed to work, it is likely failing silently behindwarnAndReturnFallback. Grep prod logs for the env-sync warning prefix to confirm.lib/sandbox/billing.ts(mode resolution),lib/vercel/target-resolution.ts,lib/vercel/reconciliation.ts,lib/vercel/reconcile-links-runner.ts,lib/vercel/validation.ts, plus branches inlib/sandbox/reaper.ts,summary.ts,debug-presenter.ts,readiness-reconciliation.ts.Proposed fix (keep the door, remove the theater)
user_vercel_projectplumbing now, or reduce it to the enum + aNOT_IMPLEMENTEDguard at launch. Either way, no half-alive branches in reaper/reconciliation.Non-goals
Building BYO compute now. This issue is cleanup + the env-sync auth fix + preserving an honest path to do it later.