Repository navigation
fix(server): price Antigravity Gemini Flash effort variants - #13809
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — This focused fix changes production usage metering by mapping Antigravity model variants to pricing models and making previously unpriced usage appear with calculated costs. Because it affects pricing and metering behavior, the change warrants human review despite its limited scope and tests. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Model recognition and rate pricing apps/server/src/provider/Drivers/antigravityUsageReader.ts, apps/server/src/provider/Drivers/antigravityUsageReader.test.ts |
The reader adds Gemini 3.5–3.8 Flash and Gemini 3 Flash Agent ID mappings. It removes additional effort and routing suffixes when deriving rate models and maps gemini-3-flash to gemini-3-flash-preview. Tests check four model-to-rate-model mappings and their costs. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related PRs
- pingdotgg/t3code#24834: Both PRs derive base rate models from Antigravity model variants for pricing.
Suggested reviewers: t3dotgg
Merge Risk: 
Minimal · up to 76567
-
No issue requiring a fix before merge was established. Normal checks can proceed.
Security architecture risk: 
Minimal · up to 9ffff
-
The change adjusts cost estimates while preserving recorded identities and existing read-only access. No new privilege, access path, or material security regression was identified in the reviewed change.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — A party able to modify metadata in scanned conversation stores can influence usage identities and cost estimates. The reviewed change alters pricing interpretation of those records without expanding scanned roots or gaining additional authority.
Trust Boundaries and Controls
- observed — Metadata-derived model names remain data: normalization produces a string key, and rate resolution performs a map lookup. The inspected path does not use that key as executable code, SQL, a filesystem path, or a credential selector.
Resilience and Maintainability Implications
- observed — The existing failure-containment behavior remains: cache entries are published after successful decoding, failed file reads are recorded and skipped, and merged results are assembled in invocation-local state. The PR does not introduce a new partial-publication or recovery transition.
-
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description is complete and relevant. It explains the problem, implementation, scope, linked issue, verification results, known limits, and unverified environments. The Scope and approval section does not state explicit maintainer approval, but the linked issue and focused-fix rationale provide sufficient context.
Full details: Linked Issues check
-
Explanation
Issue
#19189requires readable Antigravity model names instead of IDs such asantigravity-model-1073.MODEL_IDSnow maps ID 1073 and the other current Flash IDs to named generations.modelNamepreserves recorded names such asgemini-3.7-flash-control. The added reader test verifies readable names, suffix handling, preview remapping, pricing, and model recovery after merging. These changes satisfy the issue's coding requirement.
Full details: Out of Scope Changes check
-
Explanation
The changes are limited to Antigravity model mappings, base-model rate selection, and automated reader and pricing coverage. The rate selection supports the readable model records required by issue
#19189. No unrelated product area or unrelated behavior is changed.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
fdcbdd1 to
9ffff74
Compare
|
Taking over this one. I'll rebuild the implementation to current conventions, trim the tests to the minimum that proves the fix, and push to this branch. |
Fold the two rateModel computations into the final emission loop, where the post-merge model is settled, and collapse the two tests into one table. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Note Written by updated the original branch and kept @Ephraim-9's commits. merged current main, reused its verification passed:
unverified: a real antigravity account's current metadata, windows/macOS, native mobile, and electron. the captures use seeded provider-format data, not a live antigravity conversation. all 31 ci checks passed on |
**v0.1.9-nightly.20261110.4452** · 15 changes from 4 contributors - **Background command details.** Inspect background commands, their status and captured output, and navigate to their subagents. - **Requested page changes.** Agents can make changes through page tools when you ask them to. - **Expanded image navigation.** Pan zoomed images and Mermaid diagrams using a trackpad or mouse wheel. - **Antigravity usage pricing.** Usage recognizes more Antigravity models and prices their token usage more accurately. ### Plus 8 more bug fixes. <details> <summary>Full changelog</summary> ## What's Changed * fix(web): new threads use the last used project by @Yash-Singh1 in pingdotgg/t3code#33626 * fix(mobile): distinguish local ACP instances by name by @shivamhwp in pingdotgg/t3code#32467 * ci(mobile): dev clients build on Blacksmith, and mobile:install starts that build by @juliusmarminge in pingdotgg/t3code#33617 * fix(mobile): Android sidebar and composer transitions no longer reflow at rest by @juliusmarminge in pingdotgg/t3code#33599 * fix(server): price Antigravity Gemini Flash effort variants by @Ephraim-9 in pingdotgg/t3code#13809 * fix(mobile): Android feed stays at its end after the keyboard or sidebar changes by @juliusmarminge in pingdotgg/t3code#33611 * fix(server): Antigravity install no longer fails on a stale Windows Crashpad pipe by @juliusmarminge in pingdotgg/t3code#26374 * ci(mobile): Android PR preview clients build on Blacksmith by @juliusmarminge in pingdotgg/t3code#33618 * fix(web): scrolling pans expanded images and Mermaid diagrams by @shivamhwp in pingdotgg/t3code#26630 * fix(desktop): agents see visible:true while the desktop shows their tab by @shivamhwp in pingdotgg/t3code#23589 * fix(server): allow requested WebMCP writes by @shivamhwp in pingdotgg/t3code#26570 * fix(antigravity): resolve model names from usage metadata by @Yash-Singh1 in pingdotgg/t3code#33661 * fix(web): show details for background commands by @Yash-Singh1 in pingdotgg/t3code#33647 * fix(ci): store-build checkouts drop credentials without submodule cleanup by @juliusmarminge in pingdotgg/t3code#33664 * fix(web): "Use T3 Code in another app" opens the Grok Bot app by @juliusmarminge in pingdotgg/t3code#33663 **Full Changelog**: pingdotgg/t3code@v0.1.9-nightly.20261110.4449...v0.1.9-nightly.20261110.4452 </details> Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.9-nightly.20261110.4452
Integrates 15 upstream commits (nightly 4449 to 4452) with one conflict in a generated file: background commands show their details (pingdotgg#33647), Antigravity model names from usage metadata (pingdotgg#33661), Gemini Flash effort pricing (pingdotgg#13809) and an install that no longer fails on a stale Windows Crashpad pipe (pingdotgg#26374), WebMCP writes on request (pingdotgg#26570), agents see visible:true while the desktop shows their tab (pingdotgg#23589), scrolling pans expanded images and Mermaid diagrams (pingdotgg#26630), "Use T3 Code in another app" opens the Grok Bot app (pingdotgg#33663), new threads use the last used project, and mobile and CI fixes (pingdotgg#33611, pingdotgg#33599, pingdotgg#32467, pingdotgg#33664, pingdotgg#33618, pingdotgg#33617). No dependency file changed. No fork feature was added or dropped. The conflict is apps/server/src/provider/agentContextBudget.json, the measured agent context size: upstream lowered its three values by 2, 2 and 16 bytes, and the fork's mcpToolListJsonBytes was larger (52804 instead of 48233). Resolved as 5547 / 7277 / 52788 (both changes added); AgentContextBudget.test.ts confirms that the measured sizes equal these values. check:changed against the pre-merge HEAD (74 files) passes in every step: format, lint, knip, graphql, the typecheck of 41 packages, 40 test files, node --test and the react compiler check. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>


Problem
On Usage, most Antigravity tokens show as Unpriced. Two causes:
MODEL_IDStable stopped at Gemini 3.1 Pro / 3 Flash, so current Gemini Flash generations fell through to labels likeantigravity-model-1319(#19189).-low,-medium,-high,-extra-low,-tiered,-control,-thinking,-agent), which the LiteLLM rate table does not list.Change
apps/server/src/provider/Drivers/antigravityUsageReader.ts:MODEL_IDS, using the names Antigravity writes in conversation metadata.rateModelon every emitted Antigravity record to the base model with the variant suffix stripped, the same mechanism Cursor uses throughcursorRateModel.gemini-3.8-flash-highkeeps its display name and prices asgemini-3.8-flash;gemini-3-flash-*prices asgemini-3-flash-preview, the only name the table has (matching existing ids 1018/1047/1084).rateModelis derived once, in the emission loop, after alias merging has settled the final model. A model-less step that adopts a named generation's model through merging is priced too.Known limits: id 342 (
gpt-oss-120b-medium) gains a readable name but stays unpriced, because LiteLLM has no baregpt-oss-120band its provider-prefixed entries disagree on rate. Existing ids 313/329 (gemini-2.5-flash-thinking) now price atgemini-2.5-flash. Names that do not identify a generation (gemini-default) and ids without a recorded name stay unpriced on purpose.Verification
Headless before/after on Linux: a seeded Antigravity conversation store with 1M uncached input tokens per record, read with
readAntigravityUsageand priced withpriceUsageagainst the live LiteLLM table.main)antigravity-model-1319, unpricedgemini-3.8-flash-medium→gemini-3.8-flash, $0.75antigravity-model-1318, unpricedgemini-3.8-flash-high→gemini-3.8-flash, $0.75antigravity-model-1073, unpricedgemini-3.6-flash-low→gemini-3.6-flash, $0.75antigravity-model-1020, unpricedgemini-3.5-flash-low→gemini-3.5-flash, $1.50antigravity-model-1132, unpricedgemini-3-flash-agent→gemini-3-flash-preview, $0.50antigravity-model-1301, unpricedgemini-3.7-flash-tiered→gemini-3.7-flash, $0.75gemini-3.7-flash-control, unpricedgemini-3.7-flash-control→gemini-3.7-flash, $0.75vp test run src/provider/Drivers/antigravityUsageReader.test.ts src/usage/usagePricing.test.tsinapps/server: 24 passed. The one new reader test (prices Antigravity effort and routing variants at their base model) covers an id-only step, a suffixed name-only generation, thegemini-3-flash-previewremap, and the merge case; it fails with the reader reverted tomain. ExistingusagePricingtests already proverateModelis honored.vp lint,vp fmt --check, andtscforapps/serverare clean.Credit
Taken over from @Ephraim-9's original #13809, which found the ids and the suffix set and chose the
rateModelapproach. The takeover moved therateModelderivation to a single place after merging and folded the two tests into one.Fixes #19189.
Rebuilt by Claude Fable 5.1 (Claude Code in T3 Code); tests by Claude Opus 5.5; reviewed by Claude Opus 5.5 and GPT-6 Sol.
🤖 Generated with Claude Code
Resumed and independently reviewed with Claude Opus 5.5 and GPT-6 Sol; verification and preparation by GPT-6.1 Sol through the Codex harness in T3 Code.