1. 24 Mar, 2026 1 commit
  2. 21 Mar, 2026 1 commit
  3. 20 Mar, 2026 4 commits
  4. 19 Mar, 2026 4 commits
    • QTom's avatar
      feat(admin): 用户管理新增分组列、分组筛选与专属分组一键替换 · ba7d2aec
      QTom authored
      - 新增分组列:展示用户的专属/公开分组,支持 hover 查看详情
      - 新增分组筛选:下拉选择或模糊搜索分组名过滤用户
      - 专属分组替换:点击专属分组弹出操作菜单,选择目标分组后
        自动授予新分组权限、迁移绑定的 Key、移除旧分组权限
      - 后端新增 POST /admin/users/:id/replace-group 端点,事务内
        完成分组替换并失效认证缓存
      ba7d2aec
    • 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
    • Hg's avatar
      feat: add ungrouped filter to account · 8027531d
      Hg authored
      8027531d
    • haruka's avatar
      fix: record original upstream status code when failover exhausted (#1128) · 1fd1a58a
      haruka authored
      
      
      When all failover accounts are exhausted, handleFailoverExhausted maps
      the upstream status code (e.g. 403) to a client-facing code (e.g. 502)
      but did not write the original code to the gin context. This caused ops
      error logs to show the mapped code instead of the real upstream code.
      
      Call SetOpsUpstreamError before mapUpstreamError in all failover-
      exhausted paths so that ops_error_logger captures the true upstream
      status code and message.
      Co-Authored-By: default avatarClaude Opus 4.6 (1M context) <noreply@anthropic.com>
      1fd1a58a
  5. 18 Mar, 2026 5 commits
  6. 17 Mar, 2026 2 commits
  7. 16 Mar, 2026 3 commits
    • erio's avatar
      test(dashboard): add unit tests for user-breakdown API · e0286e50
      erio authored
      Handler tests (9 cases): group_id/model/endpoint filters, default
      endpoint_type, custom limit, limit clamping, response format,
      empty result, no-filter pass-through.
      
      Repository test: resolveEndpointColumn mapping for inbound/upstream/path.
      e0286e50
    • erio's avatar
      feat(dashboard): add per-user drill-down for group, model, and endpoint distributions · 4b41e898
      erio authored
      Click on a group name, model name, or endpoint name in the distribution
      tables to expand and show per-user usage breakdown (requests, tokens,
      actual cost, standard cost).
      
      Backend: new GET /admin/dashboard/user-breakdown API with group_id,
      model, endpoint, endpoint_type filters.
      Frontend: clickable rows with expand/collapse sub-table in all three
      distribution charts.
      4b41e898
    • QTom's avatar
      feat(backup): 备份/恢复异步化,解决 504 超时 · c1fab7f8
      QTom authored
      
      
      POST /backups 和 POST /backups/:id/restore 改为异步:立即返回 HTTP 202,
      后台 goroutine 独立执行 pg_dump → gzip → S3 上传,前端每 2s 轮询状态。
      
      后端:
      - 新增 StartBackup/StartRestore 方法,后台 goroutine 不依赖 HTTP 连接
      - Graceful shutdown 等待活跃操作完成,启动时清理孤立 running 记录
      - BackupRecord 新增 progress/restore_status 字段支持进度和恢复状态追踪
      
      前端:
      - 创建备份/恢复后轮询 GET /backups/:id 直到完成或失败
      - 标签页切换暂停/恢复轮询,组件卸载清理定时器
      - 正确处理 409(备份进行中)和轮询超时
      Co-Authored-By: default avatarClaude Opus 4.6 (1M context) <noreply@anthropic.com>
      c1fab7f8
  8. 15 Mar, 2026 14 commits
  9. 14 Mar, 2026 5 commits
    • Elysia's avatar
      fix(gateway): 防止流式 failover 拼接腐化导致客户端收到双 message_start · 0e237326
      Elysia authored
      
      
      当上游在 SSE 流中途返回 event:error 时,handleStreamingResponse 已将
      部分 SSE 事件写入客户端,但原先的 failover 逻辑仍会切换到下一个账号
      并写入完整流,导致客户端收到两个 message_start 进而产生 400 错误。
      
      修复方案:在每次 Forward 调用前记录 c.Writer.Size(),若 Forward 返回
      UpstreamFailoverError 后 writer 字节数增加,说明 SSE 内容已不可撤销地
      发送给客户端,此时直接调用 handleFailoverExhausted 发送 SSE error 事件
      终止流,而非继续 failover。
      
      Ping-only 场景不受影响:slot 等待期的 ping 字节在 Forward 前后相等,
      正常 failover 流程照常进行。
      Co-Authored-By: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      0e237326
    • Rose Ding's avatar
      fix: 按 review 意见重构数据库备份服务(安全性 + 架构 + 健壮性) · 1047f973
      Rose Ding authored
      
      
      1. S3 凭证加密存储:使用 SecretEncryptor (AES-256-GCM) 加密 SecretAccessKey,
         防止备份文件中泄露 S3 凭证,兼容旧的未加密数据
      2. 修复 saveRecord 竞态条件:添加 recordsMu 互斥锁保护 records 的 load/save
      3. 恢复操作增加服务端验证:handler 层要求重新输入管理员密码,通过 bcrypt
         校验,前端弹出密码输入框
      4. pg_dump/psql/S3 操作抽象为接口:定义 DBDumper 和 BackupObjectStore 接口,
         实现放入 repository 层,遵循项目依赖注入架构规范
      5. 改为流式处理避免大数据库 OOM:备份时 pg_dump stdout -> gzip -> io.Pipe ->
         S3 upload;恢复时 S3 download -> gzip reader -> psql stdin,不再全量加载
      6. loadRecords 区分"无数据"和"数据损坏"场景:JSON 解析失败返回明确错误
      7. 添加 18 个核心逻辑单元测试:覆盖加密、并发、流式备份/恢复、错误处理等
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      1047f973
    • SsageParuders's avatar
      refactor: merge bedrock-apikey into bedrock with auth_mode credential · 4644af2c
      SsageParuders authored
      Consolidate two separate channel types (bedrock + bedrock-apikey) into
      a single "AWS Bedrock" channel. Authentication mode is now distinguished
      by credentials.auth_mode ("sigv4" | "apikey") instead of separate types.
      
      Backend:
      - Remove AccountTypeBedrockAPIKey constant
      - IsBedrock() simplified; IsBedrockAPIKey() checks auth_mode
      - Add IsAPIKeyOrBedrock() helper to eliminate repeated type checks
      - Extend pool mode, quota scheduling, and billing to bedrock
      - Add RetryableOnSameAccount to handleBedrockUpstreamErrors
      - Add "bedrock" scope to Beta Policy for independent control
      
      Frontend:
      - Merge two buttons into one "AWS Bedrock" with auth mode radio
      - Badge displays "Anthropic | AWS"
      - Pool mode and quota limit UI available for bedrock
      - Quota display in account list (usage bars, capacity badges, reset)
      - Remove all bedrock-apikey type references
      4644af2c
    • Wang Lvyuan's avatar
    • Ethan0x0000's avatar
      fix: consolidate chat-completions compatibility fixes · ece0606f
      Ethan0x0000 authored
      - apply default mapped model only when scheduling fallback is actually used
      
      - preserve reasoning in OpenAI-compatible output via reasoning_content and avoid invalid input function_call ids
      ece0606f
  10. 13 Mar, 2026 1 commit
    • erio's avatar
      feat(redeem): support subscription type in create-and-redeem API · 05edb551
      erio authored
      Add group_id and validity_days fields to CreateAndRedeemCodeRequest,
      enabling subscription-type redemption codes to be created and redeemed
      in a single API call.
      
      - Type defaults to "balance" when omitted for backward compatibility
      - Subscription type requires group_id (non-nil) and validity_days (>0)
      - Existing balance/concurrency callers are unaffected
      05edb551