Repository navigation
feat(gemini): add Gemini 4 Carbon support - #8661
Merged
Merged
Conversation
Contributor
|
在 macOS arm64 上使用 Go 1.27.3 独立验证了未修改的 PR head
以上 Go 计数包含父测试和子测试事件,不是独立叶子用例数。使用标准命令完成,没有修改 PR 源码。真实 provider 账户、Antigravity 的账户可用性和 long-decode 仍未验收。 AI 披露:这些独立检查由 AI agent 自治执行,未经人工复核。 |
zacharyyyang
added a commit
to zacharyyyang/sub2api
that referenced
this pull request
Nov 11, 2026
feat(gemini): 支持 Gemini 4 Carbon(移植上游 Wei-Shaw#8661,含定价/目录/thinking)
doublepi123
added a commit
to doublepi123/sub2api
that referenced
this pull request
Nov 12, 2026
Merges d70a23f (single commit on top of 10ba8f9, an ancestor of fork main) with --no-ff so the PR author's history is preserved. Conflict: backend/internal/pkg/antigravity/claude_types_test.go - Fork had already slimmed TestDefaultModels_ContainsCallableEndpointModels to the callable set (dropping legacy image aliases). Kept the fork list and only added the PR's new "gemini-4-carbon" entry; no legacy aliases reintroduced. Carbon follows the published model ID only (no invented -low/-high routing aliases in the default mapping); legacy budget_tokens is converted to thinkingLevel and thinkingBudget is never sent for Carbon. Gemini 4 Argon three-tier aliases and existing Haiku/Kiro behaviour are untouched.
doublepi123
added a commit
to doublepi123/sub2api
that referenced
this pull request
Nov 12, 2026
Production probe of account 8 (Ultra, paidTier=g1-ultra-lite-tier) shows Antigravity's fetchAvailableModels registers Carbon only as gemini-4-carbon-low/-medium/-high, with defaultAgentModelId=gemini-4-carbon-medium and no bare gemini-4-carbon. The bare ID belongs to the Gemini API/AI Studio surface, so PR Wei-Shaw#8661's bare-only Antigravity mapping would forward an ID upstream does not list. Adaptation on top of Wei-Shaw#8661: - DefaultAntigravityModelMapping: bare gemini-4-carbon aliases to gemini-4-carbon-medium, and the three suffix identities are added. - antigravityDefaultPassthroughModels: injects the three suffixes for accounts with an explicit model_mapping (bare stays unmapped there). - The dynamic thinking-variant resolver treats a bare -> own-level-suffix mapping as a default tier, not a foreign alias, and defaults bare Carbon to medium when the client does not pin a level. - Native Gemini path: legacy thinkingConfig.thinkingBudget is converted to thinkingLevel and removed for Carbon; suffix requests just drop the budget. The Claude/OpenAI compatibility paths already never emit thinkingBudget for Carbon via buildGenerationConfig. - Static Antigravity catalog and IsGeminiReasoningModel use the three suffixes; the Gemini API catalogs (pkg/gemini, pkg/geminicli, frontend gemini list) keep the bare ID so surfaces stay separate. - Frontend Antigravity whitelist/presets use the suffixes; the bare key maps to medium as the client alias. Pricing already normalizes Carbon suffixes to its own card (2/10/0.1 per MTok, 1.8x priority) before any Argon rule; the new test pins that the suffixes never fall through to Argon or a free model. Argon's three tiers, Haiku/Kiro behavior and the auto-disabled newapi channel 14 are untouched.
|
Please 😭 @Wei-Shaw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #8658.
gemini-4-carbonmodel to Gemini native/CLI fallback catalogs, Antigravity defaults, and frontend whitelist/mapping presets. Keep legacy Google One models unchanged; do not invent Carbon preview or tier routing aliases.thinkingBudget.Validation
Scope and caveats
Official references