1. 24 Mar, 2026 6 commits
  2. 23 Mar, 2026 4 commits
    • Ethan0x0000's avatar
      feat(routes): add platform-based routing split for /v1/responses and /v1/chat/completions · d927c0e4
      Ethan0x0000 authored
      Mirror the existing /v1/messages platform split pattern:
      - OpenAI groups → OpenAIGateway handlers (existing, unchanged)
      - Non-OpenAI groups → Gateway handlers (new Anthropic-upstream path)
      
      Updated both /v1 prefixed routes and non-prefixed alias routes
      (/responses, /chat/completions). WebSocket route (/v1/responses GET)
      remains OpenAI-only as Anthropic has no WebSocket equivalent.
      d927c0e4
    • Ethan0x0000's avatar
      feat(handler): add Responses/ChatCompletions handlers on GatewayHandler · 31660c4c
      Ethan0x0000 authored
      New HTTP handlers for Anthropic platform groups accepting OpenAI-format
      endpoints:
      
      - GatewayHandler.Responses: /v1/responses for non-OpenAI groups
      - GatewayHandler.ChatCompletions: /v1/chat/completions for non-OpenAI groups
      
      Both handlers include:
      - Claude Code only restriction (403 reject when claude_code_only enabled,
        since these endpoints are never Claude Code clients)
      - Full auth → billing → user/account concurrency → failover loop
      - Ops error/endpoint context propagation
      - Async usage recording via worker pool
      
      Error responses use each endpoint's native format (Responses API format
      for /v1/responses, CC format for /v1/chat/completions).
      31660c4c
    • Ethan0x0000's avatar
      feat(service): add ForwardAsResponses/ForwardAsChatCompletions on GatewayService · 4321adab
      Ethan0x0000 authored
      New forwarding methods on GatewayService for Anthropic platform groups:
      
      - ForwardAsResponses: accept Responses body → convert to Anthropic →
        forward to upstream → convert response back to Responses format.
        Supports both streaming (SSE event-by-event conversion) and buffered
        (accumulate then convert) response modes.
      - ForwardAsChatCompletions: chain CC→Responses→Anthropic for request,
        Anthropic→Responses→CC for response. Streaming uses dual state machine
        chain with [DONE] marker.
      
      Both methods reuse existing GatewayService infrastructure:
      buildUpstreamRequest, Claude Code mimicry, cache control enforcement,
      model mapping, and return UpstreamFailoverError for handler-level retry.
      4321adab
    • Ethan0x0000's avatar
      feat(apicompat): add ResponsesAnthropic bidirectional format conversion · 68f151f5
      Ethan0x0000 authored
      Add reverse-direction converters for Anthropic platform groups to accept
      OpenAI-format requests:
      
      - ResponsesToAnthropicRequest: Responses API input → Anthropic Messages
        request with system extraction, tool/toolChoice mapping, reasoning
        effort conversion, image data URIbase64, and consecutive role merging
      - AnthropicToResponsesResponse: Anthropic response → Responses response
        with content block→output item mapping, usage, stop_reason→status
      - AnthropicEventToResponsesEvents: stateful SSE stream converter
        (Anthropic streaming protocol → Responses streaming protocol)
      - FinalizeAnthropicResponsesStream: synthetic termination for
        incomplete streams
      68f151f5
  3. 21 Mar, 2026 7 commits
  4. 20 Mar, 2026 14 commits
  5. 19 Mar, 2026 9 commits
    • erio's avatar
      fix(antigravity): correctly mark credits exhausted on "Resource has been exhausted" 429 · 21b6f2d5
      erio authored
      shouldMarkCreditsExhausted was blocked by isURLLevelRateLimit check when
      credit overages retry returned "Resource has been exhausted (e.g. check quota).",
      causing credits to never be marked as exhausted. This led to an infinite loop
      where each request injected credits, bypassed model rate limits, and failed again.
      
      - Remove isURLLevelRateLimit guard from shouldMarkCreditsExhausted (only called
        for credit retry responses — if credits retry fails, mark exhausted)
      - Add "resource has been exhausted" to creditsExhaustedKeywords
      - Update tests to match corrected behavior
      21b6f2d5
    • 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
    • QTom's avatar
      feat(admin): 用户管理新增分组列、分组筛选与专属分组一键替换 · ba7d2aec
      QTom authored
      - 新增分组列:展示用户的专属/公开分组,支持 hover 查看详情
      - 新增分组筛选:下拉选择或模糊搜索分组名过滤用户
      - 专属分组替换:点击专属分组弹出操作菜单,选择目标分组后
        自动授予新分组权限、迁移绑定的 Key、移除旧分组权限
      - 后端新增 POST /admin/users/:id/replace-group 端点,事务内
        完成分组替换并失效认证缓存
      ba7d2aec
    • Rose Ding's avatar
    • Rose Ding's avatar
      fix: Anthropic tool schema 转 Responses API 时补充缺失的 properties 字段 · 963494ec
      Rose Ding authored
      
      
      当 Claude Code 发来的 MCP tool 的 input_schema 为 {"type":"object"} 且缺少
      properties 字段时,OpenAI Codex 后端会拒绝并报错:
      Invalid schema for function '...': object schema missing properties.
      
      新增 normalizeToolParameters 函数,在 convertAnthropicToolsToResponses 中
      对每个 tool 的 InputSchema 做规范化处理后再赋给 Parameters。
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      963494ec
    • Remx's avatar
      feat(openai): 增加 gpt-5.4-mini/nano 模型支持与定价配置 · 42d73118
      Remx authored
      - 接入 gpt-5.4-mini/nano 模型识别与规范化,补充默认模型列表
      - 增加 gpt-5.4-mini/nano 输入/缓存命中/输出价格与计费兜底逻辑
      - 同步前端模型白名单与 OpenCode 配置
      - 补充 service tier(priority/flex) 计费回归测试
      42d73118
    • shaw's avatar
      feat: Anthropic 账号被动用量采样,页面默认展示被动数据 · 525cdb88
      shaw authored
      从上游 /v1/messages 响应头被动采集 5h/7d utilization 并存储到
      Account.Extra,页面加载时直接读取本地数据而非调用外部 Usage API。
      用户可点击"查询"按钮主动拉取最新数据,主动查询结果自动回写被动缓存。
      
      后端:
      - UpdateSessionWindow 合并采集 5h + 7d headers 为单次 DB 写入
      - 新增 GetPassiveUsage 从 Extra 构建 UsageInfo (复用 estimateSetupTokenUsage)
      - GetUsage 主动查询后 syncActiveToPassive 回写被动缓存
      - passive_usage_ 前缀注册为 scheduler-neutral
      
      前端:
      - Anthropic 账号 mount/refresh 默认 source=passive
      - 新增"被动采样"标签和"查询"按钮 (带 loading 动画)
      525cdb88
    • shaw's avatar
    • Hg's avatar
      feat: add ungrouped filter to account · 8027531d
      Hg authored
      8027531d