Skip to content

feat(agents): add Antigravity usage collector and panel asset - #7701

Closed
senhor-f wants to merge 1 commit into
omacom:quattrofrom
senhor-f:feat/antigravity-agent-support
Closed

senhor-f wants to merge 1 commit into
omacom:quattrofrom
senhor-f:feat/antigravity-agent-support

Conversation

@senhor-f

Copy link
Copy Markdown

PR Description

Motivation & Context

Following up on the initial Antigravity CLI integration in #6900, this PR completes the integration on the Omarchy desktop shell by adding live usage tracking, real-time rate limit monitoring, and the official vector brand asset for the Antigravity (agy) coding agent in the agents panel (omarchy.agents).


Key Changes

  1. Antigravity Usage Collector (bin/omarchy-agent-usage-antigravity):

    • Implements local transcript analysis across ~/.gemini/antigravity-cli/brain/ and fallback history.jsonl to calculate prompt counts, active sessions, and per-model token consumption (gemini-3.7-flash, gemini-3.7-pro, claude-sonnet-4-6, claude-opus-4-6, gpt-oss-120b, etc.).
    • Probes live rate limits using agy -p /usage --output-format json to extract authoritative 5-hour session and 7-day weekly quota percentages and reset countdowns for Gemini and 3rd-party models.
    • Provides graceful fallbacks when offline, missing CLI binaries, or during initial login states.
    • Integrates with omarchy-agent-usage-update to automatically emit ~/.local/state/omarchy/agents/usage/antigravity.json.
  2. Brand Assets (shell/plugins/agents/assets/):

    • Adds the official Google Antigravity vector mark (antigravity.svg and antigravity-light.svg).
    • Crafted specifically for Qt Quick's QSvgRenderer (SVG 1.2 Tiny compliance without unsupported <clipPath> definitions) with the signature Google multi-color gradient mesh.
  3. Manifest & Documentation (shell/plugins/agents/manifest.json, README.md):

    • Enables antigravity in the default providers table and updates the collector documentation.
  4. Automated Test Suite (test/shell.d/agent-usage-antigravity-scanner-test.sh):

    • Adds 12 automated unit and regression tests covering:
      • Transcript token counting & model classification.
      • Live rate limit probing with mock agy CLI output.
      • Fallbacks to history.jsonl and synthetic quota buckets when the CLI is absent.

Verification

  • Automated Tests:
    • Ran ./test/shell.d/agent-usage-antigravity-scanner-test.sh (12/12 passing).
    • Ran ./test/shell.d/agent-usage-update-test.sh (7/7 passing).
    • Ran ./test/cli (full CLI metadata & dispatch suite passing).
  • Visual Verification:
    • Triggered omarchy-shell omarchy.agents open in the live Hyprland session.
    • Verified hero rendering, tab switching, live quota meters, 7-day token chart, and per-model breakdown with omarchy capture screenshot fullscreen save.

Copilot AI balanced review requested due to automatic review settings August 21, 2026 18:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Antigravity usage tracking and branding to the agents panel.

Changes:

  • Adds transcript statistics and live quota collection.
  • Enables Antigravity by default with branded SVG assets.
  • Adds documentation and collector tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bin/omarchy-agent-usage-antigravity Implements usage collection and quota probing.
test/shell.d/agent-usage-antigravity-scanner-test.sh Tests collector behavior and fallbacks.
shell/plugins/agents/manifest.json Enables the provider by default.
shell/plugins/agents/README.md Documents Antigravity integration.
shell/plugins/agents/assets/antigravity.svg Adds the standard brand mark.
shell/plugins/agents/assets/antigravity-light.svg Adds the light-surface brand mark.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@data-goblin

data-goblin commented Aug 23, 2026 •

Copy link
Copy Markdown

Tested on 2026-08-23 with Antigravity CLI 1.1.19 and it works for me :)

I authenticated through Google OAuth on Omarchy and verified that /usage returns both Gemini and Claude/GPT quota groups, including their five-hour and weekly windows. The collector populated all four limits and the agents panel rendered them correctly.

One follow-up I found while testing is that AGY exposes two quota pools: Gemini, plus Claude/GPT-OSS. Google documents these as separate Antigravity reasoning-model groups with separate five-hour and weekly quotas: Antigravity model documentation.

Displaying all four meters is accurate, but Claude & GPT inside the Antigravity tab is easy to mistake for usage from the separate Claude Code and Codex providers. It also makes Antigravity the only tab that does not use the panel's consistent Session/Weekly shape. For users who only use Gemini through AGY, the extra pair takes up half the Limits section without being useful.

Before:

Antigravity showing four model-pool limits

The follow-up therefore shows one Session and one Weekly limit by default. Users who select Claude or GPT-OSS through AGY can opt into all four meters with:

omarchy bar set omarchy.agents showAntigravityThirdPartyLimits true --json

After:

Antigravity showing the focused Session and Weekly limits

The same commit removes synthetic quota and tier data when live limits are unavailable, derives readiness from real data, names the optional pool Claude / GPT-OSS, and prevents background quota probes from triggering AGY self-updates.

Verification passed: 17 collector assertions, 11 panel assertions, 7 updater assertions, QML lint, and the full CLI suite.

Follow-up PR against this PR's source branch: senhor-f#1

@belspectre belspectre left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great work — this is by far the most complete Antigravity integration PR. I've been running
a local version of the same collector and hit a few of the same edges. A few notes that
might be worth addressing before merge:


  1. remaining_fraction absent key — silent wrong data
remaining = float(b.get("remaining_fraction", 1.0))

1.0 as default means if agy omits the field (e.g. during an auth error), every bucket
silently renders as 0% used. Better to skip the bucket entirely:

remaining = b.get("remaining_fraction")
if remaining is None:
    continue
remaining = float(remaining)

  1. Offline fallback fabricates reset times from now

The fallback in collect_limits() emits resetsAt: now + timedelta(hours=5), which will
render a countdown in the panel from the moment of the failed probe — not the real reset time.
Since no real quota data is known offline, returning [] is cleaner; the panel already hides
the LIMITS section when the list is empty.


  1. Small lookup table makes future window types safe

The bucket_sort_key / title derivation checks for "5h" and "weekly" inline. When Google
adds new window types the fallback lands on the full bucket name as the title
("Five Hour Limit Remaining" instead of "Session"). A small dict makes it forward-safe:

_WINDOW_TITLE = {"weekly": "Weekly", "5h": "Session", "daily": "Daily", "monthly": "Monthly"}
title_suffix = _WINDOW_TITLE.get(window.lower(), window or "Limit")
title = f"{prefix} {title_suffix}"

  1. Unused import re (minor lint)

re is imported but never used — will trigger ruff/flake8 in CI.

@ChaseC-130

Copy link
Copy Markdown

Tested this implementation locally on Omarchy (quattro branch) with agy (Google Antigravity CLI).

The collector cleanly captures:

  • Live quota pools via agy -p "/usage" --output-format json (both Gemini Models and Claude/GPT 5-hour session and 7-day weekly limits with exact reset timestamps)
  • Daily prompt and session stats from ~/.gemini/antigravity-cli/history.jsonl

It renders seamlessly in the native omarchy.agents bar widget alongside Claude Code and Codex. +1 for merging this upstream so Antigravity has first-class status across all Omarchy installs!

@bjarneo

bjarneo commented Sep 20, 2026

Copy link
Copy Markdown
Member

Automated duplication check: this pull request looks similar to #8479, which covers the same Antigravity usage collector. I keep that one open and close this one to consolidate review.

If you feel this is the wrong decision, please open the PR again with a note on the difference.

@bjarneo bjarneo closed this Sep 20, 2026
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.

6 participants