Skip to content

refactor(console): remove legacy database from Console - #54585

Merged
vimtor merged 3 commits into
devfrom
console-db-removal
Oct 12, 2026
Merged

vimtor merged 3 commits into
devfrom
console-db-removal

Conversation

@vimtor

@vimtor vimtor commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The old Console no longer touches the legacy PlanetScale DB. It's now just the marketing site, docs, /api/enterprise, and a plain /zen proxy to new inference.

  • /zen/*: forwards every request it recognises to new inference without reading the request. The DB lookup (migrated_at and BYOK provider) is gone, and so are the ZEN_MODELS model list and the request-body re-streaming. New inference now handles keys, free-tier access, unknown models and billing.
  • Old dashboard and login: /auth/* and /workspace/* now 302 to ${consoleUrl}/login. Deleted the old auth context, the dashboard pages, workspace picker, user menu, referral cookie and Go referral.
  • Deleted: the support actions (/api/support/*), bench, the AuthApi (OpenAuth) worker and its KV, and the Stat worker.
  • Deleted packages: packages/console/core (schema, migrations, scripts), packages/console/support, packages/console/mail.
    • The email images moved into app/public/email, so emails that were already sent keep loading them.
  • Moved: the SES sender to app/src/lib/aws.ts; safeEqual is now inlined into the Honeycomb webhook.
  • Infra:
    • Removed the PlanetScale branch, password and Database link, the Studio dev command, and AUTH_API_URL/VITE_AUTH_URL.
    • Removed the secrets: Stripe keys, ZEN_MODELS1-30, ZEN_LIMITS, ZEN_SESSION_SECRET, the console's GitHub/Google OAuth, the dev-only Cloudflare ones, and SupportApiKey from Console (Teams still uses it).

Behavior change

  • BYOK: requests with old sk- keys from workspaces that had BYOK set up are no longer rewritten to their imported connection. They're charged to the org's credits on OpenCode's provider instead. That's about 12-17k requests a day from up to 257 orgs.
  • Errors: unknown model, missing key and invalid key now come from new inference (not translated). It already returns 401 for keyless requests to paid models and 403 for free-tier abuse.

Kept on purpose

  • Stripe Go/Black products, prices and coupons: unchanged. Removing them would archive them in Stripe, and existing subscriptions may reference them.
  • ZenData/ZenDataNew R2 buckets: unlinked but kept, because they hold the archived Zen request/response dumps we want to keep.

Rollout

Don't deploy yet.

  1. Smoke test on dev.
  2. Check PlanetScale Insights shows no queries from the Console's DB user.
  3. Deploy to production.
  4. Delete the old opencode PlanetScale database by hand. It's only looked up in infra, not managed there.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found nothing that should block this. I type-checked packages/console/app and packages/console/function (both clean) and ran the remaining app tests (25/25 pass). No code or config in the repo still refers to the deleted packages. I also tested the new proxyInference with stubbed Resource and fetch:

  • The request body reaches inference untouched.
  • sk- keys are sent on as Bearer.
  • x-zen-* headers are stripped.
  • Gemini paths go to /google/v1beta/... and keep the query string.
  • public keys are sent anonymously.
  • Unknown paths get a 404.
  • When fetch fails, the caller gets a 503.

I couldn't check it end to end because that needs a deployed stage with new inference; your dev smoke test in the rollout plan covers that.

Public API: the OpenCode SDK, plugin API, config and CLI are unchanged. Only the hosted Console's own endpoints change (/api/support/* and /bench removed, /auth and /workspace now redirect to the new Console's login, Zen error responses now come from new inference), as described.

One thing to know: on preview stages consoleUrl is empty, so /auth and /workspace (still linked from /zen and temp.tsx) now return 404 there instead of redirecting. That seems fine, since preview stages have no new Console.

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