Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: report separate Antigravity Argon quota on usage page

Adam Eivyb1a13e3c3ba7
diff --git a/server/services/providerUsage.js b/server/services/providerUsage.js
index 07d0c61af7..c60bdb62e7 100644
--- a/server/services/providerUsage.js
+++ b/server/services/providerUsage.js
@@ -561,13 +561,17 @@ export function parseAgyUsage(text, { now = Date.now() } = {}) {
let group = null;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
- const g = line.match(/^([A-Z][A-Z0-9 &/+-]*?MODELS)$/);
+ const g = line.match(/^([A-Z][A-Z0-9 &/+-]*?MODELS|GEMINI \d+ ARGON)$/);
if (g) { group = agyGroupLabel(g[1]); groups.add(group); continue; }
if (!group) continue;
// Optional " Remaining" suffix: agy 1.1.x renamed "Weekly Limit" →
// "Weekly Limit Remaining" (and same for Five Hour). Capture stops at
// "Limit" so agyWindowLabel stays agnostic of the suffix.
- const w = line.match(/^([A-Z][A-Za-z ]{0,24}?Limit)(?:\s+Remaining)?$/);
+ // Argon's separate bucket repeats its group name in the window heading.
+ const windowLine = line.toLowerCase().startsWith(`${group.toLowerCase()} `)
+ ? line.slice(group.length).trim()
+ : line;
+ const w = windowLine.match(/^([A-Z][A-Za-z ]{0,24}?Limit)(?:\s+Remaining)?$/);
if (!w) continue;
// Look ahead a few lines for the bar percentage + reset/quota-available.
let remaining = null;
diff --git a/server/services/providerUsage.test.js b/server/services/providerUsage.test.js
index 0c56cd5830..fe95874732 100644
--- a/server/services/providerUsage.test.js
+++ b/server/services/providerUsage.test.js
@@ -623,6 +623,37 @@ describe('parseAgyUsage', () => {
expect(parseAgyUsage('').limits).toEqual([]);
});
+ it('reports the separate Argon weekly bucket without replacing shared Gemini quota', () => {
+ const argon = `
+GEMINI 4 ARGON
+ For paid Pro plans, Argon quota is separate.
+
+ Gemini 4 Argon Weekly Limit
+ [██░░░░░░░░] 23.00%
+ Refreshes in 120h 15m
+`;
+ const { limits, groups } = parseAgyUsage(AGY_PANEL + argon, { now: NOW });
+ expect(groups).toBe(3);
+ expect(limits).toHaveLength(5);
+ expect(limits.find((l) => l.key === 'gemini-weekly')).toMatchObject({ percentRemaining: 99 });
+ expect(limits.find((l) => l.key === 'gemini-4-argon-weekly')).toEqual({
+ key: 'gemini-4-argon-weekly',
+ label: 'Gemini 4 Argon · Weekly',
+ scope: 'weekly',
+ model: 'Gemini 4 Argon',
+ percentUsed: 77,
+ percentRemaining: 23,
+ resetsAt: new Date(NOW + (120 * 3600 + 15 * 60) * 1000).toISOString(),
+ timezone: null,
+ });
+ const repainted = AGY_PANEL + argon + argon.replace('23.00%', '100.00%').replace('Refreshes in 120h 15m', 'Quota available');
+ const latest = parseAgyUsage(repainted, { now: NOW }).limits;
+ expect(latest).toHaveLength(5);
+ expect(latest.find((l) => l.key === 'gemini-4-argon-weekly')).toMatchObject({
+ percentUsed: 0, percentRemaining: 100, resetsAt: null,
+ });
+ });
+
it('dedups repainted frames to one row per key (no duplicate React keys)', () => {
// The append-only PTY buffer can contain the panel twice if the TUI
// repaints; latest-wins so keys stay unique and the newer value survives.