Commit Graph

8 Commits

Author SHA1 Message Date
song
7f7bbdf677 refactor(antigravity): 简化模型映射逻辑,支持前缀匹配
- 删除精确映射表 antigravityModelMapping,统一使用前缀映射
- 前缀映射支持模型版本号变化(如 -20251111, -thinking, -preview)
- 简化 IsModelSupported 函数,所有 claude-/gemini- 前缀模型都支持
- 添加跨协议测试用例:Claude 端点调用 Gemini 模型、Gemini 端点调用 Claude 模型
2026-01-01 01:43:20 +08:00
song
b31bfd53ab feat(antigravity): 添加专用路由,支持仅使用 antigravity 账户
添加 /antigravity/v1/* 和 /antigravity/v1beta/* 路由:
- 通过 ForcePlatform 中间件强制使用 antigravity 平台
- 跳过混合调度逻辑,仅调度 antigravity 账户
- 支持按分组优先查找,找不到时回退查询全部 antigravity 账户

修复 context key 类型不匹配问题:
- middleware 和 service 统一使用字符串常量 "ctx_force_platform"
- 解决 Go context.Value() 类型+值匹配导致的读取失败

其他改动:
- 嵌入式前端中间件白名单添加 /antigravity/ 路径
- e2e 测试 Gemini 端点 URL 添加 endpointPrefix 支持
2025-12-29 16:52:55 +08:00
song
1ad29032d3 feat(antigravity): 添加混合调度可选功能
- 后端:账户模型添加 IsMixedSchedulingEnabled() 方法,读取 extra.mixed_scheduling
- 后端:gateway_service 和 gemini_messages_compat_service 支持混合调度逻辑
- 后端:分组创建支持指定 platform 参数
- 前端:账户创建/编辑弹窗添加混合调度开关(仅 antigravity 账户显示)
- 前端:混合调度开关添加问号图标和 tooltip 说明
- 前端:GroupSelector 支持根据 mixedScheduling 属性过滤分组
- 前端:分组创建支持选择 platform
- 测试:e2e 测试添加 ENDPOINT_PREFIX 环境变量支持混合/隔离模式测试
- 测试:删除过时的 Claude signature 测试用例
2025-12-29 09:44:39 +08:00
song
995adaeee4 test: 添加 Claude signature 场景 e2e 测试
- 新增 TestClaudeMessagesWithClaudeSignature 测试
- 验证历史 thinking block 带有 Claude signature 时的处理
- 修复配额刷新服务的次要问题
2025-12-29 00:44:07 +08:00
song
b6b739431c build: e2e 测试添加 build tag 避免 CI 运行
- 添加 //go:build e2e tag,CI 不会自动运行这些测试
- Makefile 添加 test-e2e 目标用于本地手动运行
2025-12-28 21:59:40 +08:00
song
ff57c860e3 test: 更新 thinking signature 测试用例
将测试从无效signature改为无signature场景:
- 无效 signature 应该被上游拒绝(预期行为)
- Gemini 模型接受没有 signature 的 thinking block
2025-12-28 21:40:35 +08:00
song
ba9eb684ed fix(antigravity): 与 proxycast 保持一致的 thought_signature 处理
- function_call 无条件添加 dummy thought_signature(与 proxycast 一致)
- thinking block 在 thinking 模式下统一使用 dummy signature 替换历史无效 signature
- 添加测试用例:TestClaudeMessagesWithInvalidThinkingSignature
2025-12-28 21:29:16 +08:00
song
9594c9c83a fix(antigravity): 修复 Gemini 3 thought_signature 和 schema 验证问题
- 添加 dummyThoughtSignature 常量,在 thinking 模式下为无 signature 的 tool_use 自动添加
- 增强 cleanJSONSchema:过滤 required 中不存在的属性,确保 type/properties 字段存在
- 扩展 excludedSchemaKeys:增加 $id, $ref, strict, const, examples 等不支持的字段
- 修复 429 重试逻辑:仅在所有重试失败后才标记账户为 rate_limited
- 添加 e2e 集成测试:TestClaudeMessagesWithThinkingAndTools
2025-12-28 21:25:04 +08:00