Skip to content

fix(server): Antigravity's Gemini 4 Hydrogen (High) usage is no longer unpriced - #40901

Open
kristianbonnici wants to merge 1 commit into
pingdotgg:mainfrom
kristianbonnici:fix/antigravity-stacked-effort-suffix
Open

kristianbonnici wants to merge 1 commit into
pingdotgg:mainfrom
kristianbonnici:fix/antigravity-stacked-effort-suffix

Conversation

@kristianbonnici

@kristianbonnici kristianbonnici commented Nov 22, 2026 •

Copy link
Copy Markdown

Problem

Antigravity records Gemini 4 Hydrogen (High) as gemini-4-hydrogen-tiered-high. Usage prices an effort or routing variant at its base model's rate by stripping the suffix, but it stripped only the last one: this name looked up gemini-4-hydrogen-tiered, found no rate, and showed as Unpriced, adding $0 to the estimated cost. Its tokens were counted; only the cost was missing.

Change

antigravityRateModel strips stacked effort and routing suffixes one at a time and checks the known aliases after each step, so gemini-4-hydrogen-tiered-high prices at the gemini-4-hydrogen rate and an alias keeps its rate under a suffix (gemini-3-flash-agent-high prices as gemini-3.5-flash, not gemini-3-flash-preview). Token extraction and the overall token count are unchanged.

Scope

A small fix for an obvious bug, so no issue.

Verification

  • Added gemini-4-hydrogen-tiered-high and gemini-3-flash-agent-high to the existing test prices Antigravity effort and routing variants at their base model, with a price check for each. On main the test fails: they map to gemini-4-hydrogen-tiered and gemini-3-flash-agent, names the test's rate table has no rate for. With the fix it passes.
  • Before the rebases, ran the real readAntigravityUsage and priceUsage on main and on this branch over snapshots of my own Antigravity conversation databases. The only difference: 29 calls (0.42M tokens) recorded as gemini-4-hydrogen-tiered-high were Unpriced on main and price at the gemini-4-hydrogen rate here. No other model's records or prices changed.
  • The suffixes are stripped in a loop, not by recursion: a malformed name with 100,000 stacked suffixes resolves in about 5 ms.
  • vp run check:changed origin/main: format, lint, knip, graphql, typecheck and tests (2 files) pass; I didn't run the full CI suites or build locally.

Created with Claude Opus 5.5 in Claude Code, running in T3 Code. Reviewed by GPT-6.2 Sol in Codex, Claude Opus 5.5 in Claude Code, Orchestrator (Neon) in Antigravity and DeepSeek V4.1 Flash in OpenCode.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Antigravity usage reader now checks aliases as it removes recognized model variant suffixes. Tests cover Hydrogen tiered-high and Flash agent-high mappings, and pricing assertions for six usage records.

Changes: Antigravity rate resolution

Layer / File(s) Summary
Variant resolution and pricing
apps/server/src/provider/Drivers/antigravityUsageReader.ts, apps/server/src/provider/Drivers/antigravityUsageReader.test.ts
The reader repeatedly removes recognized suffixes and checks aliases after each removal. Tests verify Hydrogen tiered-high and Flash agent-high mappings, and check pricing for six records.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: t3dotgg

Merge Risk: Minimal · up to 46fd7

This change prices Antigravity models with stacked effort and routing suffixes at the correct base rate. Previously priced models, displayed model names and token totals are intended to stay the same. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Antigravity's Gemini 4 Hydrogen (High) usage was unpriced, and the fix now prices it. It uses the conventional commit form and matches the raw summary, which describes…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template. It states the problem (stacked effort and routing suffixes stripped one at a time, so gemini-4-hydrogen-tiered-high is Unpriced), the change (suffixes …
Full details: Title check

Explanation

The title names the main change: Antigravity's Gemini 4 Hydrogen (High) usage was unpriced, and the fix now prices it. It uses the conventional commit form and matches the raw summary, which describes stacked suffix stripping in antigravityRateModel and a new test for gemini-4-hydrogen-tiered-high.

Full details: Description check

Explanation

The description follows the repository template. It states the problem (stacked effort and routing suffixes stripped one at a time, so gemini-4-hydrogen-tiered-high is Unpriced), the change (suffixes stripped in a loop with alias checks after each step), scope (small obvious bug fix, no issue needed), and verification (updated test with before/after failure on main, a real-data comparison of 29 calls, a performance note, and the check:changed run). The template's Verification section asks for focused tests and observed results, and the author provides both. The author also names the model and harness, as the template asks. Minor gaps: the Verification section says the full CI suites were not run, and the template asks to state what was not checked, which the author does. The description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 19143b1 and 46fd777.

Files selected for processing: 2

  • apps/server/src/provider/Drivers/antigravityUsageReader.test.ts
  • apps/server/src/provider/Drivers/antigravityUsageReader.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@kristianbonnici
kristianbonnici force-pushed the fix/antigravity-stacked-effort-suffix branch from fd3456e to 19143b1 Compare November 25, 2026 22:10
@greglum

greglum commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Tested locally on 19143b1c4a (since the CI test jobs did not run on this PR):

  • The stacked-suffix case (gemini-4-hydrogen-tiered-high) still reproduces on current main (72559e12fa) after #43097, where two spellings of the same model can make rememberModel clear its mapping.
  • Ran the three targeted server suites on the PR checkout (antigravityUsageReader.test.ts, usagePricing.test.ts, usageAggregation.test.ts): 45/45 tests passed.

…r unpriced

Strip stacked effort and routing suffixes one at a time and check the known aliases after each step, so gemini-4-hydrogen-tiered-high prices at the gemini-4-hydrogen rate and gemini-3-flash-agent-high keeps the gemini-3.5-flash alias.
@kristianbonnici
kristianbonnici force-pushed the fix/antigravity-stacked-effort-suffix branch from 19143b1 to 46fd777 Compare December 5, 2026 09:38

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

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants