1. 19 Mar, 2026 1 commit
    • erio's avatar
      fix(antigravity): fast-fail on proxy unavailable, temp-unschedule account · 528ff5d2
      erio authored
      ## Problem
      
      When a proxy is unreachable, token refresh retries up to 4 times with
      30s timeout each, causing requests to hang for ~2 minutes before
      failing with a generic 502 error. The failed account is not marked,
      so subsequent requests keep hitting it.
      
      ## Changes
      
      ### Proxy connection fast-fail
      - Set TCP dial timeout to 5s and TLS handshake timeout to 5s on
        antigravity client, so proxy connectivity issues fail within 5s
        instead of 30s
      - Reduce overall HTTP client timeout from 30s to 10s
      - Export `IsConnectionError` for service-layer use
      - Detect proxy connection errors in `RefreshToken` and return
        immediately with "proxy unavailable" error (no retries)
      
      ### Token refresh temp-unschedulable
      - Add 8s context timeout for token refresh on request path
      - Mark account as temp-unschedulable for 10min when refresh fails
        (both background `TokenRefreshService` and request-path
        `GetAccessToken`)
      - Sync temp-unschedulable state to Redis cache for immediate
        scheduler effect
      - Inject `TempUnschedCache` into `AntigravityTokenProvider`
      
      ### Account failover
      - Return `UpstreamFailoverError` on `GetAccessToken` failure in
        `Forward`/`ForwardGemini` to trigger handler-level account switch
        instead of returning 502 directly
      
      ### Proxy probe alignment
      - Apply same 5s dial/TLS timeout to shared `httpclient` pool
      - Reduce proxy probe timeout from 30s to 10s
      528ff5d2
  2. 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
  3. 11 Feb, 2026 1 commit
    • Edric Li's avatar
      feat(antigravity): 添加 onboardUser 支持并修复 project_id 补齐逻辑 · a4a46a86
      Edric Li authored
      - 新增 OnboardUser API 客户端方法,支持账号 onboarding 获取 project_id
      - loadProjectIDWithRetry 增加 onboard 回退:LoadCodeAssist 未返回 project_id 时自动触发 onboarding
      - GetAccessToken 中 project_id 补齐改用轻量 FillProjectID 替代全量 RefreshAccountToken
      - 补齐逻辑增加 5 分钟冷却机制,防止频繁重试
      - OnboardUser 轮询等待改为 context 感知,支持提前取消
      - 提取 mergeCredentials 辅助方法消除重复代码
      - 新增 extractProjectIDFromOnboardResponse 和 resolveDefaultTierID 单元测试
      a4a46a86
  4. 07 Feb, 2026 1 commit
    • erio's avatar
      fix(antigravity): support upstream accounts and custom model_mapping in scheduling · de092728
      erio authored
      - 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
      de092728
  5. 02 Feb, 2026 1 commit
  6. 23 Jan, 2026 1 commit
    • shaw's avatar
      fix(token-cache): 版本过时时使用最新token而非旧token · dac6bc22
      shaw authored
      上次修复(2665230a)只阻止了写入缓存,但仍返回旧token导致403。
      现在版本过时时直接使用DB中的最新token返回。
      
      - 重构 IsTokenVersionStale 为 CheckTokenVersion,返回最新account
      - 消除重复DB查询,复用版本检查时已获取的account
      dac6bc22
  7. 22 Jan, 2026 1 commit
  8. 14 Jan, 2026 1 commit
  9. 31 Dec, 2025 1 commit
    • shaw's avatar
      refactor(service): 统一时间戳解析,支持多种格式 · 81213f23
      shaw authored
      新增 Account.GetCredentialAsTime 方法,统一处理凭证中的时间戳字段,
      兼容 RFC3339 字符串、Unix 时间戳字符串和数字类型。
      
      - 重构 Claude/Gemini/Antigravity TokenRefresher.NeedsRefresh
      - 移除重复的 parseExpiresAt/parseAntigravityExpiresAt 函数
      - 简化 GetOpenAITokenExpiresAt 实现
      - 新增 RFC3339 格式单元测试用例
      81213f23
  10. 29 Dec, 2025 1 commit
  11. 28 Dec, 2025 1 commit