1. 07 Mar, 2026 2 commits
  2. 06 Mar, 2026 5 commits
  3. 05 Mar, 2026 4 commits
    • erio's avatar
    • erio's avatar
      refactor: unify post-usage billing logic and fix account quota calculation · 02dea7b0
      erio authored
      - Extract postUsageBilling() to consolidate billing logic across
        GatewayService.RecordUsage, RecordUsageWithLongContext, and
        OpenAIGatewayService.RecordUsage, eliminating ~120 lines of
        duplicated code
      - Fix account quota to use TotalCost × accountRateMultiplier
        (was using raw TotalCost, inconsistent with account cost stats)
      - Fix RecordUsageWithLongContext API Key quota only updating in
        balance mode (now updates regardless of billing type)
      - Fix WebSocket client disconnect detection on Windows by adding
        "an established connection was aborted" to known disconnect errors
      02dea7b0
    • erio's avatar
      feat: add quota limit for API key accounts · 05527b13
      erio authored
      - Add configurable spending limit (quota_limit) for apikey-type accounts
      - Atomic quota accumulation via PostgreSQL JSONB operations on TotalCost
      - Scheduler filters out over-quota accounts with outbox-triggered snapshot refresh
      - Display quota usage ($used / $limit) in account capacity column
      - Add "Reset Quota" action in account menu to reset usage to zero
      - Editing account settings preserves quota_used (no accidental reset)
      - Covers all 3 billing paths: Anthropic, Gemini, OpenAI RecordUsage
      
      chore: bump version to 0.1.90.4
      05527b13
    • yangjianbo's avatar
      feat(openai-ws): 合并 WS v2 透传模式与前端 ws mode · 1d0872e7
      yangjianbo authored
      
      
      新增 OpenAI WebSocket v2 passthrough relay 数据面与服务适配层,
      支持按账号 ws mode 在 ctx_pool 与 passthrough 间路由。
      
      同步调整前端 OpenAI ws mode 选项为 off/ctx_pool/passthrough,
      并补充 i18n 文案与对应单测。
      
      新增 Caddyfile.dmit 与 docker-compose-aicodex.yml 部署配置,
      用于宿主机场景下的反向代理与服务编排。
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      1d0872e7
  4. 03 Mar, 2026 2 commits
    • shaw's avatar
      feat: apikey支持5h/1d/7d速率控制 · a80ec5d8
      shaw authored
      a80ec5d8
    • QTom's avatar
      fix(gateway): 分组隔离 — 禁止未分组账号被跨组调度 · 530a1629
      QTom authored
      当 API Key 无分组时,调度仅从未分组账号池中选取。
      修复 isAccountInGroup 在 groupID==nil 时的逻辑,
      同时补全 scheduler_snapshot_service 和 gemini_compat_service
      中的 SimpleMode 保护,确保分组隔离在所有调度路径生效。
      
      新增 ListSchedulableUngroupedByPlatform/s 方法,
      使用 Ent 的 Not(HasAccountGroups()) 谓词实现未分组账号隔离。
      新增 17 个单元和端到端隔离测试,覆盖所有分支和边界条件。
      530a1629
  5. 28 Feb, 2026 1 commit
  6. 22 Feb, 2026 1 commit
    • yangjianbo's avatar
      fix(codex): 修复额度窗口过期展示并补齐高覆盖测试 · 10636d8a
      yangjianbo authored
      - 后端新增绝对重置时间字段计算(codex_5h_reset_at/codex_7d_reset_at)
      
      - 前端统一窗口解析逻辑:绝对时间优先,updated_at+seconds 回退,过期自动归零
      
      - 新增后端与前端单元测试,覆盖关键边界与异常场景
      10636d8a
  7. 14 Feb, 2026 4 commits
  8. 13 Feb, 2026 2 commits
    • yangjianbo's avatar
      fix(ops): 修复日志级别过滤并增强OpenAI错误诊断日志 · f96acf6e
      yangjianbo authored
      - 移除 warn 级别下 access info 的强制入库补写,确保运行时日志级别真实生效
      
      - 将 OpenAI fallback matched 与 passthrough 断流提示按需求降级为 info
      
      - 为 codex_cli_only 与 instructions required 场景补充请求诊断字段(含 User-Agent)
      
      - 出于安全考虑移除请求体预览,仅保留 request_body_size 与白名单头信息
      
      - 新增/更新回归测试,覆盖 Forward 入口到日志落库链路
      f96acf6e
    • yangjianbo's avatar
      feat: 完善日志 · 2459eafb
      yangjianbo authored
      2459eafb
  9. 12 Feb, 2026 8 commits
  10. 11 Feb, 2026 1 commit
    • yangjianbo's avatar
      fix(openai): 修复 OAuth 透传流式断开与压缩头问题 · a88bb868
      yangjianbo authored
      - 透传流式在客户端断开后继续 drain 上游并解析 usage,避免计费信息丢失
      
      - 阻断透传 accept-encoding,避免压缩响应影响 SSE/usage 解析
      
      - 阻断 proxy-authorization,避免透传代理鉴权信息
      
      - 补充回归测试:请求头阻断与断流后 usage 采集
      a88bb868
  11. 10 Feb, 2026 2 commits
    • yangjianbo's avatar
      feat(openai): 增加 OAuth 透传开关 · f1e884ce
      yangjianbo authored
      
      
      - 仅对 Codex CLI 且账号开启时走原样透传(只替换认证)
      
      - 透传模式禁用工具修正/模型替换,并旁路解析 usage 用于计费
      
      - 管理后台增加开关与文案,ops upstream error 记录 passthrough 标记
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      f1e884ce
    • yangjianbo's avatar
      perf(backend): 使用 gjson/sjson 优化热路径 JSON 处理 · 58912d4a
      yangjianbo authored
      
      
      将 API 网关热路径中的 json.Unmarshal+json.Marshal 替换为 gjson 零拷贝查询和 sjson 精准写入:
      - unwrapV1InternalResponse 性能提升 22x(4009ns→182ns),内存分配减少 28.5x
      - unwrapGeminiResponse、extractGeminiUsage、estimateGeminiCountTokens、ParseGeminiRateLimitResetTime 改为接收 []byte 使用 gjson 提取
      - ParseGatewayRequest 的 model/stream/metadata/thinking/max_tokens 改用 gjson 类型安全提取
      - Handler 层(sora/openai)改用 gjson 提取字段、sjson 注入/修改字段,移除 map[string]any 中间变量
      - Sora Client 响应解析改用 gjson ForEach 遍历,减少内存分配
      - 新增约 100 个单元测试用例,所有改动函数覆盖率 >85%
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      58912d4a
  12. 08 Feb, 2026 1 commit
    • erio's avatar
      feat: shuffle accounts within same sort group to prevent thundering herd · 1af06aed
      erio authored
      Add post-sort shuffle for accounts with identical (priority, loadRate,
      lastUsedAt) to break deterministic ordering when concurrent requests
      read the same scheduler snapshot. Applies to both Antigravity and
      OpenAI scheduling paths, plus the sortAccountsByPriorityAndLastUsed
      helper.
      
      Keeps upstream CallCount/ModelLoadInfo scheduling intact; shuffle is
      additive and only randomises within equivalent-rank groups.
      1af06aed
  13. 07 Feb, 2026 6 commits
  14. 06 Feb, 2026 1 commit