Skip to content

feat(antigravity): adapt to latest models & quota system (add Gemini 4 Argon, 3.8 Flash, Claude 5.5, remove Gemini Pro) | 适配最新模型与配额体系 - #2915

Open
Chain813 wants to merge 13 commits into
jlcodes99:mainfrom
Chain813:feature/antigravity-models-update
Open

Chain813 wants to merge 13 commits into
jlcodes99:mainfrom
Chain813:feature/antigravity-models-update

Conversation

@Chain813

Copy link
Copy Markdown

Summary / 概述

Adapt to the latest Google Antigravity model updates and quota system architecture:

  • Supports the new flagship model Gemini 4 Argon with its dedicated quota bucket.
  • Updates Gemini 3.8 Flash, Claude Opus 5.5, and Claude Sonnet 5.5.
  • Deprecates the obsolete Gemini Pro group and restructures default auto-switch groups.
  • Sanitizes model display names by stripping all parenthetical suffixes (e.g., (Medium), (High), (Thinking)).

适配最新版 Google Antigravity 的模型变动与配额体系:

  • 支持全新独立大模型 Gemini 4 Argon 及其独立配额池。
  • 更新 Gemini 3.8 Flash、Claude Opus 5.5 与 Claude Sonnet 5.5。
  • 移除已下线的 Gemini Pro 分组,重构默认自动切号分组。
  • 清洗模型展示名称,彻底去除所有小括号后缀(如 (Medium)、(High)、(Thinking))。

Key Changes / 主要改动

1. Model Definitions & Display Name Sanitization / 模型定义与名称清洗

  • Added canonical model entries for gemini-4-argon, gemini-3.8-flash-high, claude-opus-5-5-medium, claude-sonnet-5-5-medium, and gpt-oss-120b-medium.
  • Enforced global display name sanitization using .replace(/\s*\([^)]*\)/g, '').trim() across antigravityModels.ts and modelNames.ts.
  • 在 antigravityModels.ts 与 modelNames.ts 中规范收录上述新模型,并加入全局去括号清洗逻辑,保持 UI 简洁易读。

2. Group Strategy Restructuring / 分组策略重构

  • Removed the deprecated Gemini Pro (g3_pro) default group.
  • Introduced a dedicated Gemini 4 Argon (g4_argon) group to independently track its Gemini 4 Argon Weekly Limit quota window and enable precise auto-switching.
  • Consolidated the core setup into 3 active groups: Gemini 4 Argon, Gemini Flash, and Claude.
  • Aligned definitions across cockpit-core/account.rs, src-tauri/account.rs, group_settings.rs, and groupService.ts.
  • 彻底移除 Gemini Pro 分组;为拥有独立周限额的 Gemini 4 Argon 新建独立的 g4_argon 分组;精简并对齐 Rust 核心库、Tauri 运行时与前端的 3 大核心分组。

3. Quota Capture & Presentation / 配额解析与卡片呈现

  • Broadened the quota capture filter in Rust quota.rs to include argon and gpt models (if name.contains("gemini") || name.contains("claude") || name.contains("argon") || name.contains("gpt")).
  • Updated platformAccountPresentation.ts to cleanly match argonWeekly (argon:weekly, gemini-argon-wtu-weekly) and sanitize quota card labels.
  • 放宽 Rust quota.rs 过滤器确保正确捕获 Argon 和 GPT 配额;更新卡片展示层支持 Argon 独立周限额条。

Verification / 验证

  • TypeScript Typecheck: npm run typecheck passed with 0 errors.
  • Unit Tests: node --import tsx src/presentation/antigravityQuotaPresentation.test.ts passed (11/11 tests passing, covering name sanitization and Argon weekly matching).
  • Minimal & Clean Diff: Strictly focused on Antigravity logic and tests without unnecessary dependencies or vendored file churn.
  • TS 类型检查通过:npm run typecheck(tsc --noEmit)0 错误、0 警告。
  • 单元测试全通过:11 项单测用例 100% PASS。
  • 最小改动集:严格聚焦于 Antigravity 核心改动与测试,零无关改动。

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant