Skip to content

fix(usage): price Antigravity Gemini Flash model aliases - #8997

Open
mameikagou wants to merge 1 commit into
multica-ai:mainfrom
mameikagou:fix/antigravity-gemini-pricing-20261001
Open

mameikagou wants to merge 1 commit into
multica-ai:mainfrom
mameikagou:fix/antigravity-gemini-pricing-20261001

Conversation

@mameikagou

Copy link
Copy Markdown
Contributor

What does this PR do?

Fix zero/unmapped estimated cost for current Gemini Flash usage reported by Antigravity. The agent already collects token usage, but the frontend has no Gemini price rows and backend metrics lack current Flash versions. Antigravity also reports names such as Gemini 3.8 Flash (High) and gemini-3.8-flash-high, which do not match the API SKU.

Related Issue

User-reported Gemini usage-statistics gap. This is independent of #8679: it estimates token cost, not remaining subscription quota.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Tests (adding or improving test coverage)

Changes Made

  • Add Gemini 3.5 / 3.6 / 3.7 / 3.8 Flash standard rates in both frontend usage estimates and server metrics.
  • Recognize Antigravity display names and known reasoning suffixes, including routed IDs and single context-window tags.
  • Keep unknown versions, Flash-Lite/Live/preview variants and unknown effort names unmapped instead of guessing prices.
  • Test every token bucket and both matched and rejected ID shapes.

Source: Google's official pricing, accessed 2026-10-01. Gemini 3.6–3.8 rows use the published rates through 2026-12-31 ($0.75 input / $3.75 output / $0.075 cached input per million tokens); comments explicitly flag the 2027 promotion expiry. 3.5 Flash is priced independently ($1.50 / $9 / $0.15).

How to Test

  1. cd server && go test ./internal/metrics
  2. pnpm --filter @multica/views exec vitest run runtimes/utils.test.ts
  3. Inspect estimates for Gemini 3.8 Flash (High) and gemini-3.8-flash-high usage rows: 1M uncached input tokens now estimates $0.75 rather than zero/unmapped. Unknown gemini-3.8-flash-live remains unmapped.

Validation: the full Go metrics package passes, and all 101 frontend utility tests pass. Tests use synthetic token rows and do not invoke a real agent or quota endpoint.

Thinking Path / Risks

Antigravity already reports tokens and the actual selected model. Preserve that collected identity and normalize only for price lookup, so historical labels are not rewritten and reasoning settings are not changed. Estimates remain API-equivalent costs for standard text/context tokens, not actual subscription charges. Per-turn totals do not reveal per-request pricing tiers, grounding requests or cache storage duration. No auth/token files, quota fetching, retries or agent stream behavior are changed. The static promotional prices need updating after 2026-12-31, as documented at both tables.

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have run tests locally and they pass
  • I have added or updated tests where applicable
  • I have considered and documented risks above
  • I will address all reviewer comments before requesting merge

No layout, translated copy, new runtime, UI tab, or protocol changes. No screenshots applicable.

AI Disclosure

AI tool used: Codex via Multica.

Prompt / approach: Inspect upstream issues and local Antigravity model-name diagnostics, check official pricing, implement a scoped usage-estimation fix, then review both price resolvers and regression tests.

@vercel

vercel Bot commented Sep 30, 2026

Copy link
Copy Markdown

@mameikagou is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant