Repository navigation
fix: make Start Plan entitlement billing-authoritative (#406) - #407
Merged
Merged
Conversation
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.
What
3.17+ desktops serve Start Plan as an overlay on the zai OAuth family:
providerFamilyConnectionSelectionsstaysindividual-coding-planforever while billing reports the plan active, so the selection-flag gate hid Start Plan from the dropdown entirely (#406). Flipping the flag by hand breaks the desktop's own credential resolution — it is not a safe lever in either direction.This makes the bridge decide the same way upstream does (
codingPlanProviderAvailability.ts,hasActiveStartPlan): billing is authoritative.How
queryStartPlan(the existingbilling/balanceclient) now writes a process-wide verdict on every completed query:entitled(with the grant's capability model ids),none(queried, no active plan — new internal kind, distinct fromunavailable= query failed). Failed queries leave the prior verdict standing — entitlement never flaps on a network blip.entitledentitles every coding-plan family with an OAuth login (no selection flag needed);nonesuppresses even a start-plan flag;unknown(offline / never queried) keeps the legacy flag-based gate — behavior identical to before for machines where billing can't be reached.GLM-5.3-Flashunder a glm-5.3-flash-only grant) — no more dead dropdown options.syncProviderRegistrybefore the account snapshot push; the usage-stats wire vocabulary is unchanged (nonemaps tounavailable).Verification
nonebeats flag, verdict write / no-flap, model filter, wire mapping)Fixes #406