1. 23 Apr, 2026 1 commit
    • james-6-23's avatar
      feat(rpm): RPM 限流模块优化 · dc5d42ad
      james-6-23 authored
      P0:
      - rpm_override 嵌入 Auth Cache Snapshot,消除每请求 DB 查询 (snapshot v6→v7)
      - 429 RPM 响应返回 Retry-After 头(当前分钟剩余秒数)
      
      P1:
      - ClearAll 按钮直连 DELETE API,带 loading 防重复
      - 新增 GET /admin/users/:id/rpm-status 管理员 RPM 用量查询端点
      
      优化:
      - checkRPM 从级联互斥改为并行取最严,user.rpm_limit 作为全局硬上限始终生效
      - Override/Group 变更后自动失效 auth cache
      - fail-open 语义不变,Redis 故障不阻塞业务
      dc5d42ad
  2. 21 Apr, 2026 1 commit
  3. 14 Apr, 2026 4 commits
    • erio's avatar
      fix: Messages() routing refactor and subscription group test coverage · 8548a130
      erio authored
      - Refactor OpenAI Messages() routing: pre-compute dispatch model using
        resolveOpenAIMessagesDispatchMappedModel + NormalizeOpenAICompatRequestedModel
        instead of try-fail-retry pattern with gin context passing
      - Remove openai_messages_fallback_model context anti-pattern
      - Use effectiveMappedModel directly for forward default mapped model
      - Add 3 subscription group tests covering all branch paths:
        _Blocked (no active subscription → SUBSCRIPTION_REQUIRED),
        _RequiresRepo (nil repo → SUBSCRIPTION_REPOSITORY_UNAVAILABLE),
        _AllowsActiveSubscription (valid subscription → success)
      8548a130
    • erio's avatar
      fix: restore resolveOpenAIMessagesDispatchMappedModel and reset VERSION · 24e16b7f
      erio authored
      - Restore function deleted during cherry-pick conflict resolution
      - Reset VERSION to upstream 0.1.112
      24e16b7f
    • erio's avatar
      fix: address review findings for channel restriction refactoring · 160903fc
      erio authored
      - Fix 7 stale comments still mentioning "限制检查" in handlers/services
      - Make billingModelForRestriction explicitly list channel_mapped case
      - Add slog.Warn for error swallowing in ResolveChannelMapping and
        needsUpstreamChannelRestrictionCheck
      - Document sticky session upstream check exemption
      160903fc
    • erio's avatar
      refactor: move channel model restriction from handler to scheduling phase · 2dce4306
      erio authored
      Move the model pricing restriction check from 8 handler entry points
      to the account scheduling phase (SelectAccountForModelWithExclusions /
      SelectAccountWithLoadAwareness), aligning restriction with billing:
      
      - requested: check original request model against pricing list
      - channel_mapped: check channel-mapped model against pricing list
      - upstream: per-account check using account-mapped model
      
      Handler layer now only resolves channel mapping (no restriction).
      Scheduling layer performs pre-check for requested/channel_mapped,
      and per-account filtering for upstream billing source.
      2dce4306
  4. 09 Apr, 2026 1 commit
  5. 04 Apr, 2026 7 commits
    • erio's avatar
      fix: address review findings for channel restriction refactoring · 1fca2bfa
      erio authored
      - Fix 7 stale comments still mentioning "限制检查" in handlers/services
      - Make billingModelForRestriction explicitly list channel_mapped case
      - Add slog.Warn for error swallowing in ResolveChannelMapping and
        needsUpstreamChannelRestrictionCheck
      - Document sticky session upstream check exemption
      1fca2bfa
    • erio's avatar
      refactor: move channel model restriction from handler to scheduling phase · ce41afb7
      erio authored
      Move the model pricing restriction check from 8 handler entry points
      to the account scheduling phase (SelectAccountForModelWithExclusions /
      SelectAccountWithLoadAwareness), aligning restriction with billing:
      
      - requested: check original request model against pricing list
      - channel_mapped: check channel-mapped model against pricing list
      - upstream: per-account check using account-mapped model
      
      Handler layer now only resolves channel mapping (no restriction).
      Scheduling layer performs pre-check for requested/channel_mapped,
      and per-account filtering for upstream billing source.
      ce41afb7
    • erio's avatar
      feat(channel): 渠道管理全链路集成 — 模型映射、定价、限制、用量统计 · 2555951b
      erio authored
      - 渠道模型映射:支持精确匹配和通配符映射,按平台隔离
      - 渠道模型定价:支持 token/按次/图片三种计费模式,区间分层定价
      - 模型限制:渠道可限制仅允许定价列表中的模型
      - 计费模型来源:支持 requested/upstream 两种计费模型选择
      - 用量统计:usage_logs 新增 channel_id/model_mapping_chain/billing_tier/billing_mode 字段
      - Dashboard 支持 model_source 维度(requested/upstream/mapping)查看模型统计
      - 全部 gateway handler 统一接入 ResolveChannelMappingAndRestrict
      - 修复测试:同步 SoraGenerationRepository 接口、SQL INSERT 参数、scan 字段
      2555951b
    • erio's avatar
      fix(channel): 全平台渠道映射覆盖 + 公共函数抽取 + 死代码清理 · eb385457
      erio authored
      - 4个缺失handler入口添加渠道映射+限制检查(ChatCompletions/Responses/Gemini)
      - 模型限制错误信息优化,区分"模型不可用"和"无账号"
      - OpenAI RecordUsage RequestedModel 改用 OriginalModel
      - ResolveChannelMappingAndRestrict/ReplaceModelInBody 抽取到 ChannelService 消除跨service重复
      - validateNoDuplicateModels 按 platform:model 去重
      - 删除 Channel.ResolveMappedModel 死代码和 CalculateCostWithChannel Deprecated方法
      - 移除冗余nil检查,抽取 validatePricingBillingMode 公共校验
      eb385457
    • erio's avatar
      refactor(channel): 抽取渠道映射公共函数 + OpenAI映射到body + 空响应修复 + 清理日志 · 4ea8b4cb
      erio authored
      - 抽取 ResolveChannelMappingAndRestrict 统一入口(5处→1个方法)
      - 抽取 BuildModelMappingChain 到 ChannelMappingResult 方法(5处→1行调用)
      - OpenAI 三入口 Forward 前应用渠道映射到请求体
      - OpenAI Responses/Messages 限制检查添加错误响应
      - 清理前端 3 处 console.log 调试日志
      4ea8b4cb
    • erio's avatar
      fix(channel): 模型限制用映射后模型检查 + 平台开关保留配置不删除 · 91bdcf89
      erio authored
      - OpenAI 网关三处 IsModelRestricted 改用 channelMapping.MappedModel
      - 前端平台勾选改为 enabled 开关,取消勾选不清空配置数据
      - formToAPI/校验只处理 enabled 的平台
      91bdcf89
    • erio's avatar
      feat(channel): 通配符定价匹配 + OpenAI BillingModelSource + 按次价格校验 + 用户端计费模式展示 · 8d03c52e
      erio authored
      - 定价查找支持通配符(suffix *),最长前缀优先匹配
      - 模型限制(restrict_models)同样支持通配符匹配
      - OpenAI 网关接入渠道映射/BillingModelSource/模型限制
      - 按次/图片计费模式创建时强制要求价格或层级(前后端)
      - 用户使用记录列表增加计费模式 badge 列
      8d03c52e
  6. 29 Mar, 2026 1 commit
  7. 21 Mar, 2026 1 commit
  8. 20 Mar, 2026 1 commit
  9. 19 Mar, 2026 1 commit
  10. 15 Mar, 2026 2 commits
  11. 14 Mar, 2026 1 commit
  12. 12 Mar, 2026 1 commit
  13. 09 Mar, 2026 1 commit
  14. 08 Mar, 2026 1 commit
  15. 07 Mar, 2026 2 commits
  16. 06 Mar, 2026 5 commits
  17. 05 Mar, 2026 2 commits
  18. 28 Feb, 2026 1 commit
  19. 22 Feb, 2026 1 commit
  20. 14 Feb, 2026 1 commit
  21. 12 Feb, 2026 4 commits