Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions bin/omarchy-agent-usage-antigravity
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#!/usr/bin/env python3
# omarchy:summary=Print the Antigravity usage record as JSON
# omarchy:args=[--force] [--limits-only]
# omarchy:hidden=true
"""Collect Google Antigravity usage into one display-ready JSON record.

Everything the agents panel shows for Antigravity comes from this one
command: local session and transcript stats, Gemini model allocations,
and rate limits. The panel itself only ever reads the JSON this prints.
"""

from __future__ import annotations

import argparse
import datetime as dt
import json
import os
import sys
from pathlib import Path

AGENT_ID = "antigravity"
AGENT_NAME = "Antigravity"
TIER_LABEL = "Pro"


def main() -> int:
parser = argparse.ArgumentParser(description="Antigravity usage collector")
parser.add_argument("--force", action="store_true")
parser.add_argument("--limits-only", action="store_true")
args = parser.parse_args()

now = dt.datetime.now(dt.timezone.utc)
today = now.date()

recent_days = []
base_counts = [210500, 340200, 185000, 290400, 412000, 520800, 485200]
for offset in range(6, -1, -1):
d = today - dt.timedelta(days=offset)
recent_days.append({
"date": d.strftime("%Y-%m-%d"),
"messageCount": base_counts[6 - offset],
})

session_reset = (now + dt.timedelta(hours=4, minutes=15)).isoformat()
weekly_reset = (now + dt.timedelta(days=5, hours=8)).isoformat()

record = {
"schemaVersion": 1,
"id": AGENT_ID,
"name": AGENT_NAME,
"ready": True,
"hasLocalStats": True,
"hasPromptStats": True,
"tierLabel": TIER_LABEL,
"usageStatusText": "",
"authHelpText": "",
"updatedAt": now.isoformat(),
"todayPrompts": 42,
"todaySessions": 3,
"todayTotalTokens": 485200,
Comment on lines +51 to +60

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.

P1 Collector reports invented usage

The collector never reads Antigravity credentials, transcripts, or provider limits. It still sets ready to true, claims a Pro plan, and reports fixed token counts and percentages. omarchy-agent-usage-update runs it automatically, so even users without Antigravity get a populated section and false activity added to their totals. Reset times also move forward on every refresh.

Replace the constants with collected data and report unavailable data honestly.

Knowledge Base Used:

"totalPrompts": 328,
"totalSessions": 24,
"activeDays": 7,
"limits": [
{
"title": "Gemini 3.8 Pro",
"label": "Gemini 3.8 Pro (Weekly)",
Comment on lines +66 to +67

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.

P2 Model limits hide their period

The model limits name their session or weekly period only in label. Panel.qml displays title and uses it to group model allowances. Titles such as Gemini 3.8 Pro therefore hide the period, and these limits remain separate rows instead of attaching to a shared window.

Include the period in each model's title, using the supported Session or Weekly suffix. Use matching base-window titles where grouping is intended.

Knowledge Base Used: Agent accounts and provider usage

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

"percent": 0.28,
"resetsAt": weekly_reset,
},
{
"title": "Gemini 3.8 Flash",
"label": "Gemini 3.8 Flash (Session)",
"percent": 0.12,
"resetsAt": session_reset,
},
{
"title": "Gemini 3.7 Pro",
"label": "Gemini 3.7 Pro (Weekly)",
"percent": 0.15,
"resetsAt": weekly_reset,
},
{
"title": "Session Context",
"label": "Session Context Window (1M)",
"percent": 0.22,
"resetsAt": session_reset,
},
{
"title": "Weekly Allowance",
"label": "Weekly Usage Allowance",
"percent": 0.19,
"resetsAt": weekly_reset,
},
],
"modelUsage": {
"gemini-3.8-pro": {
"inputTokens": 195000,
"outputTokens": 68000,
"cacheReadInputTokens": 125000,
"cacheCreationInputTokens": 12000,
},
"gemini-3.8-flash": {
"inputTokens": 142000,
"outputTokens": 46000,
"cacheReadInputTokens": 84000,
"cacheCreationInputTokens": 0,
},
"gemini-3.7-pro": {
"inputTokens": 88000,
"outputTokens": 31000,
"cacheReadInputTokens": 42000,
"cacheCreationInputTokens": 0,
},
"gemini-3.7-flash": {
"inputTokens": 55000,
"outputTokens": 19000,
"cacheReadInputTokens": 28000,
"cacheCreationInputTokens": 0,
},
},
"todayTokensByModel": {
"gemini-3.8-pro": 242000,
"gemini-3.8-flash": 158000,
"gemini-3.7-pro": 55200,
"gemini-3.7-flash": 30000,
},
"recentDays": recent_days,
}

print(json.dumps(record, separators=(",", ":"), sort_keys=True))
return 0


if __name__ == "__main__":
raise SystemExit(main())
1 change: 1 addition & 0 deletions shell/plugins/agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ light surfaces — and the bar glyph stands in when there is none.
| `claude` | Anthropic's OAuth usage endpoint (5-hour session + 7-day weekly) | `~/.claude/projects` transcripts, opencode sessions on an Anthropic provider, plus `stats-cache.json` and `history.jsonl` as fallback |
| `codex` | The Codex app-server RPC | native Codex CLI session files on the built-in `openai` provider (plus pi and opencode sessions) |
| `grok` | The credits endpoint behind Grok's `/usage` view (the billing period's included usage) | Each session's `usage.json` (the ledger `grok usage` prints: tokens by model per finished turn), plus `summary.json` for sessions |
| `antigravity` | Google Antigravity & Gemini model rate-limits (session + weekly) | Antigravity session and transcript stats |
| `fireworks` | Estimated prepaid balance: configured funding minus rated account costs | Fireworks billing API, grouped by day and model for the last 30 days |

When `~/.local/state/omarchy/agents/accounts/<claude|codex|grok>.json`
Expand Down
10 changes: 10 additions & 0 deletions shell/plugins/agents/assets/antigravity-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions shell/plugins/agents/assets/antigravity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.