Fix(antigravity): ultra plan detection#307
Fix(antigravity): ultra plan detection#307gongchunru wants to merge 4 commits intorobinebers:mainfrom
Conversation
There was a problem hiding this comment.
3 issues found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="plugins/antigravity/plugin.test.js">
<violation number="1" location="plugins/antigravity/plugin.test.js:240">
P2: The "unsupported tier" LS regression test currently mocks `loadCodeAssist` as HTTP 500, so it only re-tests failure handling instead of the successful-but-unsupported-tier branch.</violation>
</file>
<file name="plugins/antigravity/plugin.js">
<violation number="1" location="plugins/antigravity/plugin.js:550">
P2: LS fast path now synchronously waits on Cloud Code plan requests, causing potentially large user-visible latency when network is slow/unavailable.</violation>
<violation number="2" location="plugins/antigravity/plugin.js:550">
P2: LS user-status path disables Cloud Code refresh-token fallback, so plan override can remain stale when cached access tokens are invalid.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
@codex review |
There was a problem hiding this comment.
Pull request overview
Adds Cloud Code plan/tier resolution to the Antigravity plugin (via loadCodeAssist) and introduces a short-lived on-disk plan cache so LS results can be overridden by a newer/higher-confidence Cloud tier when appropriate.
Changes:
- Add
loadCodeAssistCloud Code request and tier→plan mapping logic, with optional OAuth refresh for tier recovery. - Introduce a
plan.jsoncache with a 30-minute max age and logic to prefer cached Cloud plan over lower LS plan. - Expand Vitest coverage for LS fast-path behavior, Cloud fallback plan resolution, tier mapping, and auth-refresh recovery.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| plugins/antigravity/plugin.js | Implements Cloud plan lookup (loadCodeAssist), plan caching, token collection, and LS/Cloud plan resolution rules. |
| plugins/antigravity/plugin.test.js | Adds tests covering cached plan override behavior, LS fallback plan fill, Cloud fallback tier mapping, and refresh recovery scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1295e9d333
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
Description
Fixes stale Antigravity plan badge detection when the local language server reports
ProbutCloud Code identifies the account as
Ultra.Previously, the plugin trusted
GetUserStatus.userStatus.planStatus.planInfo.planNamewheneverthe local Antigravity language server was available. In practice, that could lag behind the real
subscription tier and cause Ultra accounts to still render as
Pro.This change keeps local LS usage/quota data, but allows Cloud Code tier detection from
loadCodeAssistto override stale lower-priority LS plan labels. It also adds regression testsfor:
Prowhile Cloud tier isUltraGetCommandModelConfigsfallback still resolves plan fromloadCodeAssistPro/UltraRelated Issue
N/A
Type of Change
Testing
bun run buildand it succeededbun run testand all tests passbun tauri devAdditional verification performed:
npm test -- plugins/antigravity/plugin.test.js62 passed (62)bun run test:coverage920 passed (920), but the command still fails because the repo's global branchcoverage threshold is currently
89.65%, below the required90%— this is a pre-existing upstream issue, not introduced by this PR.Screenshots
Before:
Antigravity Ultra account could still show
Proin the top-right plan badge.After:
Antigravity Ultra account now shows
Ultracorrectly in the plan badge.