feat(cli): envelope-first plan-gate upgrade hints - #5943
Merged
Coly010 merged 6 commits intoJul 28, 2026
Merged
Conversation
pamelachia
marked this pull request as ready for review
July 28, 2026 10:03
Contributor
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@821b821048c8c3cfc7c35549423d0acc1af96773Preview package for commit |
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Coly010
approved these changes
Jul 28, 2026
Coly010
deleted the
pamela/growth-958-cli-surface-entitlement-upgrade-hint-from
branch
July 28, 2026 11:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paid-feature denials now read the management API's
entitlement_requirederror envelope straight off the failed response and print the upgrade hint with zero extra API calls. Previously the suggest path made 2 extra round-trips (project lookup + entitlements) per gated failure, and only 9 commands were wired at all.Changed:
plan_gate.go, TSlegacy-upgrade-suggest.ts) parse{ error: { code: "entitlement_required", feature, upgrade_url } }first; the entitlements round-trip stays as the fallback for gates that do not emit the envelope yet (v1 SSO carries no server-side gate at all).domains create/get/activate/reverifyandvanity-subdomains getnewly show the hint: envelope-only, no fallback, because thecustom_domainentitlement key is plan-level while the gate is a per-project add-on, so the old round-trip would tell Free orgs to upgrade on unrelated 404s.cli_upgrade_suggestedreports the server-authoritative feature:feature_keycomes from the envelope (fixes abranching_persistentdenial being logged asbranching_limit);org_slugis parsed fromupgrade_url.AGENTS.mdtelemetry table and the affectedSIDE_EFFECTS.mdfiles updated to match.Note: the envelope's
upgrade_urlis server-built and printed without a host check. This trusts the management API host the same way every authenticated call already does; a host allowlist would silently suppress valid hints on profiles whose dashboard URL differs from the CLI default.To test
Requires a Free-org project ref (to hit the gates).
Tested locally against prod (
bun src/legacy/main.ts, Free org):domains get --project-ref <free-ref> --agent noprints "Upgrade your plan: .../org//billing" on stderr;--debugshows exactly one HTTP request, no project/entitlements lookupsvanity-subdomains getshows the same hint via the decorated server gate (since the develop merge bringing in fix(cli): gate vanity-subdomains and network-restrictions behind --experimental (CLI-1972) #5945, this command additionally needs--experimentalorSUPABASE_EXPERIMENTAL=1to get past the experimental gate)Before / after
domains get --project-ref <free-ref> --agent noon the same Free-org project, stderr verbatim (ref and org slug redacted). Before is the merge-base with develop (3ad3b875), after is this branch.Before, the envelope is already in the raw error JSON but nothing reads it, so no hint:
After, the hint prints first, still exactly one HTTP request (
--debugshows only the/custom-hostnameGET):Linear