Skip to content

fix(server): price Antigravity Gemini Flash effort variants - #13809

Open
Ephraim-9 wants to merge 4 commits into
pingdotgg:mainfrom
Ephraim-9:fix/antigravity-model-pricing
Open

Ephraim-9 wants to merge 4 commits into
pingdotgg:mainfrom
Ephraim-9:fix/antigravity-model-pricing

Conversation

@Ephraim-9

@Ephraim-9 Ephraim-9 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

apps/server/src/usage/antigravityUsageReader.ts:

  • Adds the Antigravity model IDs for the current Gemini Flash variants to MODEL_IDS (1020, 1072, 1073, 1132, 1133, 1187, 1298, 1299, 1301, 1318, 1319, 1320, 1322, 342). Names are the ones Antigravity itself writes next to each ID in conversation metadata.
  • Sets rateModel on Antigravity records, like cursorRateModel already does for Cursor: the effort/routing suffix (-low, -medium, -high, -extra-low, -tiered, -control, -thinking, -agent) is stripped for pricing only, so gemini-3.8-flash-high keeps its name but prices as gemini-3.8-flash. gemini-3-flash resolves to gemini-3-flash-preview, matching the existing IDs 1018/1047/1084.

Why

On Usage, most Antigravity tokens show as Unpriced. The ID table stops at Gemini 3.1 Pro / 3 Flash, so current models fall through to antigravity-model-<id>, and name-based records carry variant suffixes that the LiteLLM table does not list.

On my data (1,028 Antigravity conversation stores) about 1.5B tokens were unpriced, mostly antigravity-model-1319 (796M) and -1318 (347M); the header read "API estimate excludes 38.7% unpriced records". With this change they price at the base model. Names that do not identify a generation (gemini-pro-default, gemini-default) and IDs without a recorded name stay unpriced on purpose.

Verification

  • New test in usageTranscriptReader.test.ts covers an ID-only step (1319, 1132) and a name-only generation (Gemini 3.7 Flash Control), asserting display model and rateModel. It fails without the reader change.
  • vp test run src/usage/ in apps/server: 7 files, 109 tests passed. tsc --noEmit: clean. vp fmt --check: clean.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (n/a)
  • I included a video for animation/interaction changes (n/a)

🤖 Generated with Claude Code (Claude Opus 5.5, driven from T3 Code)

Summary by CodeRabbit

  • Bug Fixes
    • Improved usage pricing for additional GPT-OSS and Gemini model variants, including supported effort and routing variants.
    • Gemini 3 Flash variants now use the corresponding preview model’s rate for pricing, while retaining their normalized model names in usage records.
    • Model selection and fallback behavior remain unchanged.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 26, 2026
Comment thread apps/server/src/usage/antigravityUsageReader.ts
@macroscopeapp

macroscopeapp Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR changes production usage pricing by mapping Antigravity effort variants to rate-table models and correcting merged-record pricing state. Because it affects billing/metering behavior, and the supplied unresolved Medium finding concerns alias-merge pricing, human review is warranted.

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f5d0b5b4-72cc-43db-b79b-a404f3f47d58

📥 Commits

Reviewing files that changed from the base of the PR and between 295d7cb and fdcbdd1.

📒 Files selected for processing (2)
  • apps/server/src/usage/antigravityUsageReader.ts
  • apps/server/src/usage/usageTranscriptReader.test.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.


📝 Walkthrough

Walkthrough

The Antigravity usage reader recognizes additional model IDs and derives a base rate model from supported model variants. Usage records and merged aliases retain their existing model-selection behavior and include the derived rate model.

Changes

Antigravity Usage Model Mapping

Layer / File(s) Summary
Model recognition and rate normalization
apps/server/src/usage/antigravityUsageReader.ts
The model ID table adds GPT-OSS and Gemini Flash variants. Rate-model derivation strips recognized suffixes and maps Gemini 3 Flash to gemini-3-flash-preview.
Rate models in usage records
apps/server/src/usage/antigravityUsageReader.ts, apps/server/src/usage/usageTranscriptReader.test.ts
Usage records and merged aliases derive rateModel from the selected model. Tests check effort variants and a merged Gemini 3.8 Flash High alias.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: maria-rcks

Merge Risk: ⚪ Minimal · up to fdcbd

The mapping change is mergeable after normal checks; no unresolved pricing failure is established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to fdcbd

The change affects estimated usage prices, not the identified access controls or deployment behavior. No introduced security issue was established, although the assessment does not cover every upstream access path.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The identified effect is on price estimates for Antigravity records read by the server. The changed derivation adds neither persistent database writes nor a new sensitive sink in the scoped path.

Trust Boundaries and Controls

  • inferred — Provider database contents remain an input to model selection, but the changed mapping does not expand the reader’s directory traversal or database authority. Authentication and tenant isolation above the identified caller were not verified.

Resilience and Maintainability Implications

  • inferred — The new normalization is a deterministic transformation of each selected model. Read state is invocation-local, limiting the change’s effect on repetition and independent reads; concurrent external database mutation was not assessed.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: pricing Antigravity Gemini Flash effort variants. It is concise and specific.
Description check ✅ Passed The description explains what changed, why it changed, verification results, and checklist status. It accurately covers the non-UI scope and remains focused.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 1, 2026 — with ChatGPT Codex Connector

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

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants