1. 15 Mar, 2026 1 commit
    • erio's avatar
      feat: unified OAuth token refresh API with distributed locking · 1fc9dd7b
      erio authored
      Introduce OAuthRefreshAPI as the single entry point for all OAuth token
      refresh operations, eliminating the race condition where background
      refresh and inline refresh could simultaneously use the same
      refresh_token (fixes #1035).
      
      Key changes:
      - Add OAuthRefreshExecutor interface extending TokenRefresher with CacheKey
      - Add OAuthRefreshAPI.RefreshIfNeeded with lock → DB re-read → double-check flow
      - Add ProviderRefreshPolicy / BackgroundRefreshPolicy strategy types
      - Simplify all 4 TokenProviders to delegate to OAuthRefreshAPI
      - Rewrite TokenRefreshService.refreshWithRetry to use unified API path
      - Add MergeCredentials and BuildClaudeAccountCredentials helpers
      - Add 40 unit tests covering all new and modified code paths
      1fc9dd7b
  2. 02 Feb, 2026 1 commit
  3. 24 Jan, 2026 2 commits
    • Ubuntu's avatar
      fix(oauth): 彻底修复 project_id 丢失问题 · 716272a1
      Ubuntu authored
      
      
      根本原因:
      - BuildAccountCredentials 只在 project_id 非空时才添加该字段
      - LoadCodeAssist 失败时返回空字符串 → 新 credentials 不包含 project_id 键
      - 普通合并逻辑只保留新 credentials 中不存在的键,无法覆盖空值
      
      解决方案:
      1. 在合并后特殊处理 project_id:如果新值为空但旧值非空,保留旧值
      2. LoadCodeAssist 失败不再返回错误,只记录警告
      3. Token 刷新成功(access_token 已更新)就不应标记账户为 error
      
      改进效果:
      - 即使 LoadCodeAssist 连续失败,已有的 project_id 也不会丢失
      - 避免因临时网络问题将账户误标记为不可用
      - 允许在下次刷新时自动重试获取 project_id
      Co-Authored-By: default avatarClaude Sonnet 4.5 <noreply@anthropic.com>
      716272a1
    • Ubuntu's avatar
      fix(oauth): 修复 OAuth 令牌刷新时 missing_project_id 误报问题 · ffaa6c4a
      Ubuntu authored
      
      
      问题描述:
      在网络波动环境下,LoadCodeAssist 临时失败会被错误地标记为
      "missing_project_id" 不可重试错误,导致账户被禁用。但实际上
      账户配置正确,手动刷新后即可恢复。
      
      解决方案:
      1. 为 LoadCodeAssist 增加重试机制(最多4次,指数退避)
      2. 区分真正的配置缺失和临时网络故障:
         - 如果之前有 project_id,本次获取失败只保留旧值,不报错
         - 只有从未获取过 project_id 且本次也失败时,才标记为缺失
      3. 优化错误判断逻辑,避免误报
      
      改进效果:
      - 提高在复杂网络环境(如家宽代理)下的鲁棒性
      - 减少因临时网络波动导致的服务中断
      - 保持真正配置错误的检测能力
      Co-Authored-By: default avatarClaude Sonnet 4.5 <noreply@anthropic.com>
      ffaa6c4a
  4. 16 Jan, 2026 1 commit
    • song's avatar
      fix: Antigravity 刷新 token 时检测 project_id 缺失 · 95fe1e81
      song authored
      - 刷新 token 后调用 LoadCodeAssist 获取 project_id
      - 如果获取失败,保留原有 project_id,标记账户为 error
      - token 仍会正常更新,不影响凭证刷新
      - 错误信息:账户缺少project id,可能无法使用Antigravity
      95fe1e81
  5. 31 Dec, 2025 3 commits
  6. 28 Dec, 2025 1 commit