liuxiongfeng
130112a84a
fix: 补齐 Antigravity OAuth 账号 project_id 获取逻辑
...
部分账号 loadCodeAssist 不会立即返回 cloudaicompanionProject,
导致转发时 project 字段为空,上游返回 400 "Invalid project resource name projects/"。
- 新增 OnboardUser API:当 loadCodeAssist 未返回 project_id 时,
通过 onboardUser 完成账号初始化并获取 project_id
- token 刷新时增加 onboard 兜底逻辑
- GetAccessToken 按需补齐:转发时发现 project_id 为空立即触发刷新
- 新增 resolveDefaultTierID 单元测试
2026-02-11 12:25:04 +08:00
erio
de0927289e
fix(antigravity): support upstream accounts and custom model_mapping in scheduling
...
- GetAccessToken: add upstream branch to read api_key from credentials
- shouldTriggerAntigravitySmartRetry: relax check from IsOAuth to Platform-based
- isModelSupportedByAccount/WithContext: replace IsAntigravityModelSupported
whitelist with mapAntigravityModel for unified scheduling/forwarding logic
- mapAntigravityModel: fix edge case where wildcard target equals request model
- Update tests for new behavior and add custom model_mapping test cases
2026-02-07 14:32:08 +08:00
shaw
dac6bc2228
fix(token-cache): 版本过时时使用最新token而非旧token
...
上次修复(2665230 )只阻止了写入缓存,但仍返回旧token导致403。
现在版本过时时直接使用DB中的最新token返回。
- 重构 IsTokenVersionStale 为 CheckTokenVersion,返回最新account
- 消除重复DB查询,复用版本检查时已获取的account
2026-01-23 10:29:52 +08:00
shaw
2665230a09
fix(token-cache): 修复异步刷新与请求线程的缓存竞态条件
...
- 新增 _token_version 版本号机制,防止过期 token 污染缓存
- TokenRefreshService 刷新成功后写入版本号并清除缓存
- TokenProvider 写入缓存前检查版本,过时则跳过
- ClearError 时同步清除 token 缓存
2026-01-22 21:09:28 +08:00
yangjianbo
daf10907e4
fix(认证): 修复 OAuth token 缓存失效与 401 处理
...
新增 token 缓存失效接口并在刷新后清理
401 限流支持自定义规则与可配置冷却时间
补齐缓存失效与 401 处理测试
测试: make test
2026-01-14 15:55:44 +08:00
shaw
81213f2324
refactor(service): 统一时间戳解析,支持多种格式
...
新增 Account.GetCredentialAsTime 方法,统一处理凭证中的时间戳字段,
兼容 RFC3339 字符串、Unix 时间戳字符串和数字类型。
- 重构 Claude/Gemini/Antigravity TokenRefresher.NeedsRefresh
- 移除重复的 parseExpiresAt/parseAntigravityExpiresAt 函数
- 简化 GetOpenAITokenExpiresAt 实现
- 新增 RFC3339 格式单元测试用例
2025-12-31 16:25:45 +08:00
song
42e2c5061d
fix: gofmt
2025-12-29 18:15:13 +08:00
song
1d085d982b
feat: 完善 Antigravity 多平台网关支持,修复 Gemini handler 分流逻辑
2025-12-28 17:48:52 +08:00