Repository navigation
fix(pricing): default cost rows for Antigravity Gemini 3.5 Flash tiers + gemini-pro-agent - #4508
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Code Review
This pull request adds pricing configurations and corresponding unit tests for the Antigravity Gemini 3.5 Flash and Gemini 3.1 Pro model aliases (gemini-3-flash-agent, gemini-3.5-flash-low, and gemini-pro-agent). The reviewer feedback correctly points out that gemini-3.5-flash-low maps to the upstream ID gemini-3.5-flash-extra-low for downstream calculations, meaning a pricing entry and unit test for gemini-3.5-flash-extra-low are also required to prevent fallback to $0.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| "gemini-3.5-flash-low": { | ||
| input: 0.5, | ||
| output: 3.0, | ||
| cached: 0.03, | ||
| reasoning: 4.5, | ||
| cache_creation: 0.5, | ||
| }, |
There was a problem hiding this comment.
The pricing row for the Gemini 3.5 Flash (Low) tier is missing. According to open-sse/config/antigravityModelAliases.ts, the client ID gemini-3.5-flash-low maps to the upstream ID gemini-3.5-flash-extra-low. Since downstream cost and quota accounting are keyed by upstream model IDs, looking up pricing for the Low tier will query gemini-3.5-flash-extra-low, which will return null and silently fall back to $0. Please add a pricing row for gemini-3.5-flash-extra-low as well.
"gemini-3.5-flash-low": {
input: 0.5,
output: 3.0,
cached: 0.03,
reasoning: 4.5,
cache_creation: 0.5,
},
"gemini-3.5-flash-extra-low": {
input: 0.5,
output: 3.0,
cached: 0.03,
reasoning: 4.5,
cache_creation: 0.5,
},| test("ag/gemini-3.5-flash-low matches the Gemini 3.5 Flash (Medium) tier", () => { | ||
| const p = getDefaultPricing().ag["gemini-3.5-flash-low"]; | ||
| assert.equal(p.input, 0.5); | ||
| assert.equal(p.output, 3.0); | ||
| assert.equal(p.cached, 0.03); | ||
| assert.equal(p.reasoning, 4.5); | ||
| assert.equal(p.cache_creation, 0.5); | ||
| }); |
There was a problem hiding this comment.
Add a unit test to verify the pricing for the Gemini 3.5 Flash (Low) tier (gemini-3.5-flash-extra-low).
| test("ag/gemini-3.5-flash-low matches the Gemini 3.5 Flash (Medium) tier", () => { | |
| const p = getDefaultPricing().ag["gemini-3.5-flash-low"]; | |
| assert.equal(p.input, 0.5); | |
| assert.equal(p.output, 3.0); | |
| assert.equal(p.cached, 0.03); | |
| assert.equal(p.reasoning, 4.5); | |
| assert.equal(p.cache_creation, 0.5); | |
| }); | |
| test("ag/gemini-3.5-flash-low matches the Gemini 3.5 Flash (Medium) tier", () => { | |
| const p = getDefaultPricing().ag["gemini-3.5-flash-low"]; | |
| assert.equal(p.input, 0.5); | |
| assert.equal(p.output, 3.0); | |
| assert.equal(p.cached, 0.03); | |
| assert.equal(p.reasoning, 4.5); | |
| assert.equal(p.cache_creation, 0.5); | |
| }); | |
| test("ag/gemini-3.5-flash-extra-low matches the Gemini 3.5 Flash (Low) tier", () => { | |
| const p = getDefaultPricing().ag["gemini-3.5-flash-extra-low"]; | |
| assert.equal(p.input, 0.5); | |
| assert.equal(p.output, 3.0); | |
| assert.equal(p.cached, 0.03); | |
| assert.equal(p.reasoning, 4.5); | |
| assert.equal(p.cache_creation, 0.5); | |
| }); |
…s + gemini-pro-agent
The Antigravity public catalog (ANTIGRAVITY_PUBLIC_MODELS in
open-sse/config/antigravityModelAliases.ts) ships these as user-callable
client ids:
- gemini-3-flash-agent → "Gemini 3.5 Flash (High)"
- gemini-3.5-flash-low → "Gemini 3.5 Flash (Medium)"
- gemini-pro-agent → "Gemini 3.1 Pro (High)" (v1.23+ Agent mode)
But the ag block in the default pricing table only carried rows for
gemini-3-flash and gemini-3.1-pro-high, so getPricingForModel("ag", id)
returned null and cost / quota accounting silently fell back to $0 for
those three models.
Seed the missing rows with the per-MTok rates the upstream quota tier
bills at (Flash High/Medium share the legacy gemini-3-flash rate;
gemini-pro-agent shares gemini-3.1-pro-high).
Locked in by tests/unit/pricing-ag-flash-tiers.test.ts (TDD: failed
before the seed, passes after).
Inspired-by: decolua/9router#1361
Co-authored-by: YourAnsh <Ansh7473@users.noreply.github.com>
9404e44 to
23ab2a1
Compare
…s + gemini-pro-agent (cheaper-inference#4508) Rebuilt onto release/v3.8.33 (squash-base-stale). Integrated into release/v3.8.33.
Summary
Antigravity's public catalog (
ANTIGRAVITY_PUBLIC_MODELSinopen-sse/config/antigravityModelAliases.ts) ships these as user-callable client ids:gemini-3-flash-agent→ "Gemini 3.5 Flash (High)"gemini-3.5-flash-low→ "Gemini 3.5 Flash (Medium)"gemini-pro-agent→ "Gemini 3.1 Pro (High)" (v1.23+ Agent mode)But the
agblock in the default pricing table (src/shared/constants/pricing.ts) only carried rows forgemini-3-flashandgemini-3.1-pro-high, sogetPricingForModel("ag", id)returnednulland downstream cost / quota accounting silently fell back to$0for those three models.Seed the missing rows with the per-MTok rates the upstream quota tier bills at:
gemini-3-flashrate ($0.50 / $3.00 / $0.03 / $4.50 / $0.50).gemini-pro-agentshares thegemini-3.1-pro-highrate ($4.00 / $18.00 / $0.50 / $27.00 / $4.00).Why surgical, not the full upstream change
Upstream PR (CommonJS fork) also rewrites the Antigravity model registry to swap legacy ids (
gemini-3.1-pro-high,gemini-2.5-flash,claude-sonnet-4-5*) for the new ids. OmniRoute already has that work — and far more comprehensively:ANTIGRAVITY_PUBLIC_MODELSalready lists all three of these ids (open-sse/config/antigravityModelAliases.ts:33,128).ANTIGRAVITY_MODEL_ALIASESalready maps the legacy → upstream id transitions OmniRoute exposes (gemini-3.5-flash-high → gemini-3-flash-agent, etc.).ANTIGRAVITY_PRO_FALLBACK_CHAINS([agy] gemini-3.1-pro-high returns 400 in v3.8.23 -- upstream ID format changed #3786) already does the per-requestgemini-3.1-pro-high → gemini-pro-agent → gemini-3-pro-highfallback the upstream PR was working around statically.The only genuine OmniRoute gap was pricing, so this PR ports just that.
Test plan
tests/unit/pricing-ag-flash-tiers.test.tsfailed before the seed (TypeError: Cannot read properties of undefined (reading 'input')), passes after — 3/3.node --import tsx/esm --test tests/unit/pricing-sync.test.ts tests/unit/pricing-route-sources.test.ts tests/unit/pricing-sync-extended.test.ts tests/unit/pricing-cc-anthropic-rates.test.ts tests/unit/t12-pricing-updates.test.ts→ 31/31 pass.npm run typecheck:core→ clean (exit 0).npx eslint src/shared/constants/pricing.ts tests/unit/pricing-ag-flash-tiers.test.ts→ clean.