Skip to content

Add Antigravity usage and quota collector for AI agents panel - #10515

Closed
cicciokio wants to merge 1 commit into
omacom:quattrofrom
cicciokio:add-antigravity-usage-collector
Closed

cicciokio wants to merge 1 commit into
omacom:quattrofrom
cicciokio:add-antigravity-usage-collector

Conversation

@cicciokio

@cicciokio cicciokio commented Sep 6, 2026 •

Copy link
Copy Markdown

Adds Google Antigravity (agy) to the AI agent usage monitoring panel in the Omarchy status bar (omarchy.agents), joining the existing claude, codex, and fireworks collectors.

Collector (bin/omarchy-agent-usage-antigravity)

  • Quotas and rate limits: Probes agy /usage via structured JSON output (with graceful fallback to text regex) to extract 5-hour session and 7-day weekly quotas for Gemini Models and Claude/GPT models:
    • Formats clean human-readable UI titles (Gemini Weekly, Gemini Session, Claude/GPT Weekly, Claude/GPT Session).
    • Prioritizes the active model's quota group.
    • Computes utilization percentages and preserves ISO 8601 UTC reset timestamps (resetsAt).
  • Smart caching: Caches /usage probe results for 120 seconds in $XDG_CACHE_HOME/omarchy/agent-usage/antigravity-limits.json to prevent unnecessary CLI spawning during periodic shell bar refreshes. Respects --force and --limits-only to bypass cache.
  • Token volume and local stats:
    • Scans ~/.gemini/antigravity-cli/brain/*/ transcripts to accurately aggregate input and output tokens across conversation steps, dynamic model switches, and recent days (recentDays / todayTotalTokens).
    • Generates full per-model breakdown (modelUsage, todayTokensByModel), enabling the "TOKENS BY DAY" and "TOKENS BY MODEL" panel sections.
    • Aggregates user prompt counts, sessions, and active days from history.jsonl with prompt-based token fallback when transcripts are absent.
  • Contract compliance: Prints a display-ready JSON record matching Omarchy agent schemaVersion 1 with dynamic tierLabel read from settings.json, ready, hasPromptStats, and authHelpText.

Asset & Docs

  • Ships shell/plugins/agents/assets/antigravity.svg for the panel hero and switcher chip.
  • Updates shell/plugins/agents/README.md documenting Antigravity in the collector table.

Tests

  • Updates test/shell.d/agent-usage-antigravity-test.sh covering unauthenticated/offline fallback, prompt aggregation, transcript token calculation, dynamic tierLabel, and structured JSON quota parsing.
  • All unit tests pass cleanly.

Collects usage statistics, quotas, and model breakdowns for Google
Antigravity (agy) into the AI agents panel in the Omarchy status bar.

- Quotas and rate limits: probes agy /usage via structured JSON output
  (with text fallback) to extract 5-hour and 7-day quotas for Gemini and
  Claude/GPT models, with clean UI titles and reset timestamps.
- Smart caching: caches rate limits in $XDG_CACHE_HOME/omarchy/agent-usage/
  with 120s TTL; respects --force and --limits-only flags.
- Token volume and model stats: scans ~/.gemini/antigravity-cli transcripts
  to compute realistic input/output tokens and per-model consumption,
  with history.jsonl prompt counting and graceful fallback.
- Dynamic tier: reads the active model tier from settings.json.
- Ships antigravity.svg asset and unit tests covering offline fallback,
  token extraction, and quota parsing.
@cicciokio
cicciokio force-pushed the add-antigravity-usage-collector branch from acefc4a to 0113fd0 Compare September 19, 2026 08:18
@bjarneo

bjarneo commented Sep 21, 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 21, 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.

2 participants