Skip to content

Port upstream 0.70.0: Antigravity Gemini 3.1 Pro pricing aliases (stacked on #706) - #732

Open
Finesssee wants to merge 1 commit into
port/micro-0.64.0-antigravity-cost-followupsfrom
port/micro-0.70.0-antigravity-pricing-aliases
Open

Finesssee wants to merge 1 commit into
port/micro-0.64.0-antigravity-cost-followupsfrom
port/micro-0.70.0-antigravity-pricing-aliases

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Summary

Antigravity records Gemini 3.1 Pro under product aliases and effort tiers (gemini-pro-default, gemini-pro-agent, gemini-3.1-pro, gemini-3.1-pro-high, gemini-3.1-pro-low, and suffixed forms such as gemini-3.1-pro-thinking). None of these names is a catalogued model, so this history stayed unpriced. These rows now get list-price estimates from gemini-3.1-pro-preview, the only catalogued Gemini 3.1 Pro row.

  • Lookup order is unchanged from upstream: the exact recorded model first (so an explicitly catalogued alias keeps its own price), then the pricing base. The base is an alias's catalogued model, or the base of a -tiered / -low / -thinking routing variant resolved through the same alias table.
  • Aliases match case-insensitively (Gemini-Pro-Default).
  • The alias table is Antigravity-local (rust/src/providers/antigravity/cost.rs). Shared Claude/models.dev pricing still reports unknown variants as unpriced.
  • Recorded model names are never rewritten. LocalCostEstimate::unpriced_models keeps the recorded name. An unpriced alias also adds google/gemini-3.1-pro-preview to the bounded models.dev refresh that Port upstream 0.64.0: Antigravity cost follow-ups - lower bounds, withheld reads, --refresh (stacked on #610) #706 introduced.

Stacked on #706 (port/micro-0.64.0-antigravity-cost-followups) rather than #610, because #706 rewrites the same cost.rs (refresh targets) and the docs/CLI.md Antigravity paragraph. Merge after #706.

Upstream reference

  • steipete/CodexBar v0.70.0, PR Price aliased Antigravity and Codex models steipete/CodexBar#4094 (commit 84669209372e4871be073d8a0c62d01cd0cb82c5), Antigravity half only: AntigravityLocalReader.pricingBaseModelID(for:), pricingModelAliases, costUSD (exact model, then base).
  • Tests translated from AntigravityLocalReaderTests (v0.70.0): the pricingBaseModelID expectations (gemini-3.8-flash-tiered, gemini-3.1-pro-low, claude-opus-4-6-thinking, gemini-3.8-flash -> none, -low -> none, the five aliases, Gemini-Pro-Default). Also "gemini pro product aliases price from the catalogued preview model": google gemini-3.1-pro-preview at input 1 / output 2 / cache read 0.2 USD per million tokens, expected 111e-6 + 50 * 0.2e-6 + 37 * 2e-6. Also the shared-target guard (claude-fixture-9-thinking targets do not include claude-fixture-9).

Ported / Deferred

Ported:

  • The alias table and its resolution order, with case-insensitive matching.
  • An alias reached through a routing suffix, which upstream also handles (pricingModelAliases[base.lowercased()] ?? base).
  • The docs note (docs/CLI.md, Antigravity cost paragraph).

Windows differences:

  • Windows has no per-model Antigravity cost breakdown, so upstream's "breakdown keeps gemini-pro-default" assertion has no direct counterpart. Its intent is kept: pricing resolves without renaming the recorded model, and unpriced rows keep the recorded name.
  • The tests price through an injected models.dev snapshot (estimate_cost_usd_with plus ModelsDevPricingSnapshot::from_catalog_json_for_tests), using the same built-in-then-routed resolution as production. They never read the per-user models.dev cache.

Deferred:

  • The Codex half of upstream Price aliased Antigravity and Codex models steipete/CodexBar#4094 (Codex model aliases in core/cost_pricing.rs) is a separate v0.70.0 backlog item, "Codex Sol cutoff, Cyber rates and daybreak aliases", owned by another lane.
  • The CHANGELOG entry is left to the release/v0.70.0 integration, like the sibling micro PRs in this stack.

Validation

At 77dc904a (in W:\wcb-wt\lane-a, toolchain 1.98.0):

  • cargo +1.98.0 fmt --all --check: pass
  • cargo +1.98.0 clippy --workspace --all-targets -- -D warnings: pass
  • cargo +1.98.0 test -p codexbar --lib antigravity::cost: 10 passed (5 new)
  • cargo +1.98.0 test -p codexbar: 2252 passed, 0 failed, 1 ignored
  • cargo +1.98.0 test -p codexbar-desktop-tauri: 478 passed, 1 failed. The failure is bootstrap_payload_exposes_every_provider_variant, the known hardcoded-count drift from Isolate bootstrap payload test from real settings #684 that Make the bootstrap catalog test hermetic (#684) #711 fixes. It is unrelated to this change.
  • Frontend unchanged.

Affected areas

  • rust/src/providers/antigravity/cost.rs: alias table, pricing_base_model, injectable estimate_cost_usd_with, and tests.
  • docs/CLI.md: the Antigravity cost paragraph.

UI proof

Not applicable: this is a backend pricing change only, with no UI or locale change. The existing Usage & Spend rendering shows the resulting estimate, which unit tests cover.

Port the Antigravity half of upstream CodexBar 0.70.0 steipete#4094: gemini-pro-default, gemini-pro-agent and the gemini-3.1-pro effort tiers price as gemini-3.1-pro-preview, after the exact recorded model and before routing-suffix bases. The alias stays provider-local, recorded model names stay unchanged, and an unpriced alias also refreshes the catalogued preview row.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e2fb7710-1b80-49dd-977b-c80a17dc08fc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Adversarial validation passed at a49d1b5

Scope: Antigravity Gemini 3.1 Pro pricing aliases (#732, upstream 0.70.0 steipete#4094/8466920937, audit row 5a), validated as merged into release/v0.70.0 (merge a49d1b5 = merge of 77dc904 into 8a8f3f5).

Attacks (against the 0.70.0 audit behavior spec, audit-0.70.0.md row 5a):

  • Alias coverage: the merged tree maps gemini-pro-default, gemini-pro-agent, gemini-3.1-pro, gemini-3.1-pro-high and gemini-3.1-pro-low (case-insensitive) to gemini-3.1-pro-preview — all five aliases the audit named — with the -tiered/-low/-thinking routing suffixes stripped first so gemini-3.1-pro-high-thinking prices the preview row, matching upstream 8466920.
  • Near misses stay unaliased: the catalogued row itself (gemini-3.1-pro-preview) needs no base, gemini-pro (no version) is NOT inferred, gemini-3.1-pro-max and the flash family stay out of the Pro alias table; gemini-3.8-flash-tiered still routes to its own base, so the alias table is genuinely provider-local and not a catch-all.
  • Provider-locality preserved: the alias resolution lives in pricing_base_model, which is only consulted by the Antigravity cost path; the shared CostUsagePricing Claude path never sees it — the audit's "shared Claude pricing keeps unknown variants unpriced" rule holds. A claude-fixture-9-thinking test asserts the shared resolver still reports it unpriced rather than silently billing it at the base rate.
  • Recorded model names unchanged: the estimate annotates the pricing base but never rewrites the recorded model id, matching the audit's "The recorded model name itself is never rewritten; only the price lookup resolves."
  • Fallback ordering: the aliases are checked BEFORE the routing-suffix strip in pricing_base_model, so a plain gemini-3.1-pro-low resolves via the alias without needing the suffix path, matching upstream ordering.

No defects found. READY for the un-draft rule.

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