Skip to content

Fix(antigravity): ultra plan detection#307

Open
gongchunru wants to merge 4 commits intorobinebers:mainfrom
gongchunru:fix/antigravity-ultra-plan-detection
Open

Fix(antigravity): ultra plan detection#307
gongchunru wants to merge 4 commits intorobinebers:mainfrom
gongchunru:fix/antigravity-ultra-plan-detection

Conversation

@gongchunru
Copy link

@gongchunru gongchunru commented Mar 17, 2026

Description

Fixes stale Antigravity plan badge detection when the local language server reports Pro but
Cloud Code identifies the account as Ultra.

Previously, the plugin trusted GetUserStatus.userStatus.planStatus.planInfo.planName whenever
the 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
loadCodeAssist to override stale lower-priority LS plan labels. It also adds regression tests
for:

  • LS returns Pro while Cloud tier is Ultra
  • GetCommandModelConfigs fallback still resolves plan from loadCodeAssist
  • Cloud-only fallback still resolves Pro / Ultra
  • tier refresh / unsupported-tier fallback behavior

Related Issue

N/A

Type of Change

  • Bug fix
  • New feature
  • New provider plugin
  • Documentation
  • Performance improvement
  • Other (describe below)

Testing

  • I ran bun run build and it succeeded
  • I ran bun run test and all tests pass
  • I tested the change locally with bun tauri dev

Additional verification performed:

  • Ran npm test -- plugins/antigravity/plugin.test.js
  • Result: 62 passed (62)
  • Built and verified locally using the debug Tauri app bundle
  • Ran bun run test:coverage
  • Result: 920 passed (920), but the command still fails because the repo's global branch
    coverage threshold is currently 89.65%, below the required 90% — this is a pre-existing upstream issue, not introduced by this PR.

Screenshots

Before:
Antigravity Ultra account could still show Pro in the top-right plan badge.

After:
Antigravity Ultra account now shows Ultra correctly in the plan badge.

image

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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-ai with guidance or docs links (including llms.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.

@validatedev
Copy link
Collaborator

@codex review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 loadCodeAssist Cloud Code request and tier→plan mapping logic, with optional OAuth refresh for tier recovery.
  • Introduce a plan.json cache 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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants