Skip to content

feat: 更新 Antigravity 默认模型映射预设#58

Merged
solarhell merged 1 commit intomainfrom
feat/update-antigravity-model-mapping
Jan 16, 2026
Merged

feat: 更新 Antigravity 默认模型映射预设#58
solarhell merged 1 commit intomainfrom
feat/update-antigravity-model-mapping

Conversation

@Bowl42
Copy link
Collaborator

@Bowl42 Bowl42 commented Jan 16, 2026

User description

Summary

  • 同步 Antigravity-Manager 的模型映射配置
  • 新增 gpt-4o、o1、o3 系列映射
  • 新增具体的 Claude 模式映射
  • 更新 gpt-4* 目标为 gemini-3-pro-high

Test plan

  • 验证 gpt-4o 请求映射到 gemini-3-flash
  • 验证 o1/o3 请求映射到 gemini-3-pro-high
  • 验证 Claude 模型映射正确

PR Type

enhancement


Description

  • Update Antigravity model mapping configuration

  • Add mappings for gpt-4o, o1, o3 series

  • Introduce specific Claude model mappings

  • Change gpt-4* target to gemini-3-pro-high


Diagram Walkthrough

flowchart LR
  A["Update Model Mapping"] -- "Add new mappings" --> B["gpt-4o, o1, o3 series"]
  A -- "Introduce Claude mappings" --> C["Specific Claude models"]
  A -- "Change target for gpt-4*" --> D["gemini-3-pro-high"]
Loading

File Walkthrough

Relevant files
Enhancement
model_mapping.go
Update model mapping rules                                                             

internal/adapter/provider/antigravity/model_mapping.go

  • Updated model mapping rules
  • Added new mappings for gpt-4o, o1, o3
  • Introduced specific Claude model mappings
  • Changed gpt-4* target model
+19/-9   

同步 Antigravity-Manager 的模型映射配置:

新增映射:
- gpt-4o* → gemini-3-flash
- o1-* → gemini-3-pro-high
- o3-* → gemini-3-pro-high
- claude-3-5-sonnet-* → claude-sonnet-4-5
- claude-3-opus-* → claude-opus-4-5-thinking
- claude-opus-4-* → claude-opus-4-5-thinking
- claude-haiku-* → gemini-2.5-flash-lite
- claude-3-haiku-* → gemini-2.5-flash-lite

变更映射:
- gpt-4* 目标从 gemini-2.5-pro 改为 gemini-3-pro-high

保留宽泛通配符 (*opus*, *sonnet*, *haiku*) 作为回退
@github-actions
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Logic Change

The order of model mappings has changed, which may affect the mapping behavior. Ensure that the new priorities are correct and do not introduce unintended mapping issues.

// OpenAI 协议映射表 - 按优先级排序
{"gpt-4o-mini*", "gemini-2.5-flash"}, // gpt-4o-mini 系列 (优先于 gpt-4o)
{"gpt-4o*", "gemini-3-flash"},        // gpt-4o 系列 (优先于 gpt-4)
{"gpt-4*", "gemini-3-pro-high"},      // 所有 gpt-4 变体
{"gpt-3.5*", "gemini-2.5-flash"},     // 所有 gpt-3.5 变体
{"o1-*", "gemini-3-pro-high"},        // OpenAI o1 系列
{"o3-*", "gemini-3-pro-high"},        // OpenAI o3 系列

// Claude 模型 - 具体模式优先
{"claude-3-5-sonnet-*", "claude-sonnet-4-5"},    // Claude 3.5 Sonnet
{"claude-3-opus-*", "claude-opus-4-5-thinking"}, // Claude 3 Opus
{"claude-opus-4-*", "claude-opus-4-5-thinking"}, // Claude 4 Opus
{"claude-haiku-*", "gemini-2.5-flash-lite"},     // Claude Haiku
{"claude-3-haiku-*", "gemini-2.5-flash-lite"},   // Claude 3 Haiku

// 通用 Claude 回退 (宽泛通配符放最后)
{"*opus*", "claude-opus-4-5-thinking"}, // 所有 opus 变体
{"*sonnet*", "claude-sonnet-4-5"},      // 所有 sonnet 变体
{"*haiku*", "gemini-2.5-flash-lite"},   // 所有 haiku 变体

@github-actions
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Clarify priority of model mappings

Ensure that the mapping for gpt-4o is correctly prioritized over gpt-4. If the
intention is to have gpt-4o* take precedence, verify that the order of the rules
reflects this priority. Consider adding comments to clarify the intended behavior.**

internal/adapter/provider/antigravity/model_mapping.go [22]

+{"gpt-4o*", "gemini-3-flash"},        // gpt-4o 系列 (优先于 gpt-4)
 
-
Suggestion importance[1-10]: 5

__

Why: The suggestion addresses the importance of order in model mappings, but the existing and improved code are identical, indicating no actual change is proposed.

Low
Ensure no conflicts in model mappings

Verify that the mapping for claude-3-5-sonnet-* does not conflict with other
mappings. Ensure that it is correctly prioritized to avoid unintended matches with
broader patterns. Consider testing with various inputs to confirm expected behavior.

internal/adapter/provider/antigravity/model_mapping.go [29]

+{"claude-3-5-sonnet-*", "claude-sonnet-4-5"},    // Claude 3.5 Sonnet
 
-
Suggestion importance[1-10]: 5

__

Why: The suggestion highlights the need to verify mapping conflicts, but again, the existing and improved code are the same, showing no modifications are suggested.

Low

@solarhell solarhell enabled auto-merge (squash) January 16, 2026 07:10
@solarhell solarhell merged commit 6d63216 into main Jan 16, 2026
1 check passed
@solarhell solarhell deleted the feat/update-antigravity-model-mapping branch January 16, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants