fix(antigravity): prefer userTier.name over legacy planInfo.planName#369
Conversation
The planInfo.planName field inherited from Windsurf/Codeium always returns 'Pro' for all paid tiers, including Google AI Ultra subscribers. The userTier object added by Google contains the accurate subscription name. This fix reads userTier.name first and falls back to planInfo.planName for backward compatibility when userTier is absent. Fixes robinebers#368
There was a problem hiding this comment.
Pull request overview
This PR fixes incorrect tier display in the Antigravity plugin by using Google’s userTier.name when available, instead of the legacy planStatus.planInfo.planName field that reports "Pro" for all paid tiers.
Changes:
- Update LS
GetUserStatusparsing to preferuserTier.namewith a fallback toplanInfo.planName. - Extend the Antigravity test fixture to support
userTieroverrides. - Add tests covering: prefer
userTier.name, fallback whenuserTieris missing, and fallback whenuserTier.nameis empty.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| plugins/antigravity/plugin.js | Switch plan label source to userTier.name first, with legacy fallback. |
| plugins/antigravity/plugin.test.js | Add fixture override + new test cases validating tier selection behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| expect(result.plan).toBe("Pro") | ||
|
|
There was a problem hiding this comment.
The test asserts result.plan twice with the same expectation; the second expect(result.plan).toBe("Pro") is redundant and makes the test noisier without adding coverage. Consider keeping a single assertion (and the explanatory comment if desired).
| expect(result.plan).toBe("Pro") |
| if (ut && ut.name) { | ||
| plan = ut.name | ||
| } else { | ||
| var ps = data.userStatus.planStatus || {} | ||
| var pi = ps.planInfo || {} | ||
| plan = pi.planName || null |
There was a problem hiding this comment.
userTier.name is accepted as-is when truthy; if it’s non-string (e.g. an object) or whitespace-only, plan may become an unexpected type/blank label. To keep plan reliably a meaningful string, gate on typeof ut.name === "string" and use ut.name.trim() (falling back when the trimmed value is empty). Consider applying the same string/trim normalization to pi.planName for consistency with other plugins.
| if (ut && ut.name) { | |
| plan = ut.name | |
| } else { | |
| var ps = data.userStatus.planStatus || {} | |
| var pi = ps.planInfo || {} | |
| plan = pi.planName || null | |
| var userTierName = | |
| ut && typeof ut.name === "string" && ut.name.trim() ? ut.name.trim() : null | |
| if (userTierName) { | |
| plan = userTierName | |
| } else { | |
| var ps = data.userStatus.planStatus || {} | |
| var pi = ps.planInfo || {} | |
| plan = | |
| typeof pi.planName === "string" && pi.planName.trim() ? pi.planName.trim() : null |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…cate assertion
- Gate userTier.name and planInfo.planName with typeof === 'string'
and .trim() to prevent non-string or whitespace-only plan labels
- Remove duplicate expect(result.plan).toBe('Pro') in test
Summary
Fixes #368 — Ultra subscribers are incorrectly displayed as "Pro" in the Antigravity plugin.
Problem
The
GetUserStatusresponse contains two separate tier identifiers:planStatus.planInfo.planName"Pro"❌userTier.name"Google AI Ultra"✅The plugin was reading
planInfo.planName, which always returns"Pro"for all paid tiers regardless of whether the user is on Pro or Ultra.Fix
Prefer
userTier.namewhen available, falling back toplanInfo.planNamefor backward compatibility:Tests
Summary by cubic
Fixes incorrect plan labels in the Antigravity plugin by preferring
userTier.nameover the legacyplanInfo.planName. Ultra subscribers now display as "Google AI Ultra" instead of "Pro", with guards for empty or non-string values.userTier.name; fall back toplanStatus.planInfo.planNamefor backward compatibility.userTier, and emptyuserTier.name.Written for commit cb63b20. Summary will update on new commits.