Skip to content

fix(pricing): recognize -xhigh suffix in Antigravity Gemini alias mapping - #877

Merged
james-6-23 merged 1 commit into
james-6-23:mainfrom
yanhao98:fix/antigravity-xhigh-pricing-alias
Nov 13, 2026
Merged

james-6-23 merged 1 commit into
james-6-23:mainfrom
yanhao98:fix/antigravity-xhigh-pricing-alias

Conversation

@yanhao98

@yanhao98 yanhao98 commented Nov 13, 2026 •

Copy link
Copy Markdown

问题背景

gemini-4-hydrogen 引入了新的 -xhigh 思考档位后缀(gemini-4-hydrogen-xhigh),但上游同步源(如 models.dev / litellm)仅包含裸模型名 gemini-4-hydrogen。

目前 database/model_pricing_override.go 中的 antigravityCanonicalPricingModel 仅剥离 "-high", "-medium", "-low", "-tiered",导致 gemini-4-hydrogen-xhigh 无法映射回 gemini-4-hydrogen 继承同步定价(仍回落为 $1/$2 默认价),而同系列的 -low / -medium / -high 均可正常同步为 $1.50/$0.075/$7.50。

修改内容

  • database/model_pricing_override.go:在 antigravityCanonicalPricingModel 的 gemini- 后缀列表中加入 "-xhigh"(置于 "-high" 之前)。
  • database/model_pricing_override_test.go:补充 gemini-4-hydrogen-xhigh 在 TestPricingManagementModelKeyPreservesIndependentAlias 与 TestAntigravityPricingAliasInheritance 中的测试用例。

测试验证

go test ./database -run 'TestPricingManagementModelKeyPreservesIndependentAlias|TestAntigravityPricingAliasInheritance' -v

以上用例全部 PASS。

Summary by CodeRabbit

  • Bug Fixes
    • Gemini model pricing now recognizes the -xhigh variant and applies the canonical model’s pricing, including inherited input, output, and cache-read prices.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Gemini pricing canonicalization now strips the -xhigh suffix. Tests cover the management key, alias target, and inheritance of synced prices from the base model.

Changes: Gemini xhigh pricing alias

Layer / File(s) Summary
Canonicalization and price inheritance
database/model_pricing_override.go, database/model_pricing_override_test.go
Canonicalization strips the -xhigh suffix. Tests verify that gemini-4-hydrogen-xhigh remains a management key, aliases to gemini-4-hydrogen, and inherits its synced input, output, and cache-read prices.

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

Change: Bug fix

Possibly related PRs

  • james-6-23/codex2api#834: Adds tier-suffix normalization for Antigravity pricing inheritance, which this change extends with -xhigh.

Suggested reviewers: james-6-23

Merge Risk: Minimal · up to 5d8e6

This change makes the gemini-4-hydrogen-xhigh alias inherit pricing from gemini-4-hydrogen. No merge-blocking risk is evident from the supplied changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the actual change: the Antigravity Gemini alias mapping now recognizes the -xhigh suffix. The raw summary confirms that antigravityCanonicalPricingModel now strips -xhigh for Gemini mo…
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.
Full details: Title check

Explanation

The title names the actual change: the Antigravity Gemini alias mapping now recognizes the -xhigh suffix. The raw summary confirms that antigravityCanonicalPricingModel now strips -xhigh for Gemini models, and the tests cover the gemini-4-hydrogen-xhigh alias inheritance. The title is specific, concise, and free of file lists or vague terms.

Finishing Touches

Generate unit tests (beta)

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

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 83c42a26-eada-4fbe-9549-9759f1876910
Commits

Reviewing files that changed from the base of the PR and between 811ad45 and 5d8e6ff.

Files selected for processing: 2

  • database/model_pricing_override.go
  • database/model_pricing_override_test.go

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

@james-6-23
james-6-23 merged commit b010c4b into james-6-23:main Nov 13, 2026
12 of 13 checks passed
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.

2 participants