Skip to content

feat(antigravity): track the Claude and GPT models pool separately - #178

Merged
CodeZeno merged 2 commits into
CodeZeno:mainfrom
fix2it:feat/agy-second-pool
Oct 19, 2026
Merged

CodeZeno merged 2 commits into
CodeZeno:mainfrom
fix2it:feat/agy-second-pool

Conversation

@fix2it

@fix2it fix2it commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Note

Dependency: This PR is stacked on top of #177 (feat/agy-quota-request). Please review and merge #177 first. Once merged, the base branch of this PR will automatically update to main.

Summary

Adds full support for Antigravity's two distinct quota pools: first-party Gemini Models and third-party Claude and GPT models, featuring independent menu toggles, distinct visual branding, and smooth opacity-based crossfading of metrics and labels in the Compact Fluent Quad theme.

Motivation & Architecture

Antigravity manages quotas in two separate groups:

  1. Gemini Models (Flash, Pro) — 5-hour session + weekly limits.
  2. Claude and GPT models (Opus, Sonnet, GPT-OSS) — separate tier-based 5-hour + weekly limits.

Until now, the monitor only tracked a single Antigravity pool. This PR enables users to view and toggle both pools independently while maintaining full backward compatibility for existing themes and external readers.

Key Changes

  1. Data Model & Poller:
    • UsageData now carries an optional external_pool: Option<Box<UsageData>>.
    • Distinct cache keys: antigravity_gemini, antigravity_external, and legacy antigravity (mirrors the primary pool for older readers).
  2. Settings & Context Menu:
    • Added independent toggles for the Gemini pool (command 68) and External pool (command 67) inside the Antigravity submenu. Command 62 continues to toggle the provider as a whole.
    • Per-pool enabled state is persisted cleanly in settings.json.
  3. Compact Fluent Quad Theme:
    • Introduced antigravity.gemini.* and antigravity.external.* data context bindings.
    • Dual Split Progress Bars: Displays both pools simultaneously with dedicated branding colors (#00D2B4 for Gemini, #6EB4C8 for Claude/GPT).
    • Smooth Opacity Crossfade: When both pools are enabled, the single compact column seamlessly alternates between Gemini and Claude/GPT descriptions, percentages, and countdowns via animated crossfade opacity (antigravity.crossfade_opacity), avoiding any abrupt text jumps.
    • If only one pool is enabled, it remains permanently visible without cycling.
  4. Tooltips & Other Themes:
    • Non-compact themes (Classic, etc.) continue to map antigravity.* to Gemini without layout disruption.
    • Tray tooltip cleanly lists quotas for both pools when available.
    • Unreported pools/windows display -- with an empty gauge instead of 0%.

Verification & Tests

  • Comprehensive unit tests in src/theme_engine/tests.rs verifying:
    • Solo Gemini mode, solo External mode, and dual-pool alternating modes.
    • Smooth crossfade opacity evaluation and bounds.
    • Context menu toggle state round-trips.
    • Data context resolution and theme fallback invariants.
  • Tested and verified on Windows 10 and Windows 11 taskbars.

fix2it and others added 2 commits October 18, 2026 22:37
The summary picked the first group with windows when the Gemini group
did not match, so the widget showed the "Claude and GPT models" quota
under the Antigravity name.

- The first endpoint that returns retrieveUserQuotaSummary is
  authoritative and returned at once; endpoints are no longer merged and
  fetchAvailableModels is skipped when the summary answered.
- Groups are classified as Gemini or external (claude/gpt/3p-* buckets);
  an unrecognised group is used only when it is the sole group.
- A summary without recognised windows (or with an empty group list) is
  "no limit data", not a failure.
- The model-quota fallback uses Gemini models only, because per-model
  quotas do not say which window they belong to.
- Send an explicit Antigravity User-Agent; try the sandbox endpoint last.
- Absent windows are cached with `percentage: null` so external readers
  see "unknown" rather than 0% used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Antigravity has two quota groups: Gemini and the external "Claude and
GPT models" group. Both are now polled and shown.

- UsageData carries the external group as `external_pool`.
- Cache keys: `antigravity_gemini`, `antigravity_external`, and the
  legacy `antigravity`, which mirrors the external pool for existing
  readers and is omitted when that pool is absent.
- Settings and menus toggle each pool (command 67 external, 68 Gemini;
  62 still toggles the whole provider). Re-saving settings keeps the
  per-pool choice, and a disabled provider is not re-enabled on load.
- Compact Fluent Quad shows `antigravity.gemini.*` and
  `antigravity.external.*`, alternating on a shared crossfade timer
  when both are on. Other themes keep `antigravity.*` = Gemini.
- A pool or window that was not reported shows "--" and an empty gauge,
  never 0% used; the tray tooltip lists both pools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CodeZeno
CodeZeno merged commit cc13d11 into CodeZeno:main Oct 19, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants