1. 30 Mar, 2026 1 commit
  2. 27 Mar, 2026 1 commit
    • shaw's avatar
      feat(tls-fingerprint): 新增 TLS 指纹 Profile 数据库管理及代码质量优化 · 1854050d
      shaw authored
      新增功能:
      - 新增 TLS 指纹 Profile CRUD 管理(Ent schema + 迁移 + Admin API + 前端管理界面)
      - 支持账号绑定数据库中的自定义 TLS Profile,或随机选择(profile_id=-1)
      - HTTPUpstream.DoWithTLS 接口从 bool 改为 *tlsfingerprint.Profile,支持按账号指定 Profile
      - AccountUsageService 注入 TLSFingerprintProfileService,统一 usage 场景与网关的 Profile 解析逻辑
      
      代码优化:
      - 删除已被 TLSFingerprintProfileService 完全取代的 registry.go 死代码(418 行)
      - 提取 3 个 dialer 的重复 TLS 握手逻辑为 performTLSHandshake() 共用函数
      - 修复 GetTLSFingerprintProfileID 缺少 json.Number 处理的 bug
      - gateway_service.Forward 中 ResolveTLSProfile 从重试循环内重复调用改为预解析局部变量
      - 删除冗余的 buildClientHelloSpec() 单行 wrapper 和 int64(e.ID) 无效转换
      - tls_fingerprint_profile_cache.go 日志从 log.Printf 改为 slog 结构化日志
      - dialer_capture_test.go 添加 //go:build integration 标签,防止 CI 失败
      - 去重 TestProfileExpectation 类型至共享 test_types_test.go
      - 修复 9 个测试文件缺少 tlsfingerprint import 的编译错误
      - 修复 error_policy_integration_test.go 中 handleError 回调签名被错误替换的问题
      1854050d
  3. 20 Mar, 2026 1 commit
    • wucm667's avatar
      fix: quota display shows stale cumulative usage after daily/weekly reset · 0d45d866
      wucm667 authored
      The quota reset mechanism is lazy — quota_daily_used/quota_weekly_used
      in the database are only reset on the next IncrementQuotaUsed call.
      The scheduling layer (IsQuotaExceeded) correctly checks period expiry
      before enforcing limits, so the account remains usable. However, the
      API response mapper reads the raw DB value without checking expiry,
      causing the frontend to display cumulative usage (e.g. 110%) even
      after the reset period has passed.
      
      Add IsDailyQuotaPeriodExpired/IsWeeklyQuotaPeriodExpired methods and
      use them in the mapper to return used=0 when the period has expired.
      0d45d866
  4. 15 Mar, 2026 1 commit
  5. 14 Mar, 2026 3 commits
    • 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
      fix: remove unused wildcard mapping helper · a377e990
      Wang Lvyuan authored
      a377e990
    • Wang Lvyuan's avatar
      4e8615f2
  6. 13 Mar, 2026 3 commits
    • Ylarod's avatar
      sub2api: add bedrock support · 11f7b835
      Ylarod authored
      11f7b835
    • wucm667's avatar
      refactor: 将 ComputeQuotaResetAt 和 ValidateQuotaResetConfig 函数中的 map 类型从... · 2573107b
      wucm667 authored
      refactor: 将 ComputeQuotaResetAt 和 ValidateQuotaResetConfig 函数中的 map 类型从 map[string]interface{} 修改为 map[string]any
      2573107b
    • wucm667's avatar
      feat: 账号配额支持固定时间重置模式 · 5b850059
      wucm667 authored
      - 后端新增 rolling/fixed 两种配额重置模式,支持日配额和周配额
      - fixed 模式下可配置重置时刻(小时)、重置星期几(周配额)及时区(IANA)
      - 在 account_repo.go 中使用 SQL 表达式适配两种模式的过期判断与重置时间推进
      - 新增 ComputeQuotaResetAt / ValidateQuotaResetConfig 等辅助函数
      - DTO 层新增相关字段并在 mappers 中完整映射
      - 前端 QuotaLimitCard 新增 rolling/fixed 切换 UI、时区选择器
      - CreateAccountModal / EditAccountModal 透传新配置字段
      - i18n(zh/en)同步新增相关翻译词条
      5b850059
  7. 08 Mar, 2026 1 commit
  8. 07 Mar, 2026 1 commit
    • erio's avatar
      feat(account): add daily/weekly periodic quota limits for API Key accounts · 1ee17383
      erio authored
      
      
      Extend the existing total quota limit with daily and weekly periodic
      dimensions. Each dimension is independently configurable and uses lazy
      reset — when the period expires, usage is automatically reset to zero on
      the next increment. Any dimension exceeding its limit will pause the
      account from scheduling.
      
      Backend:
      - Add GetQuotaDailyLimit/Used, GetQuotaWeeklyLimit/Used, HasAnyQuotaLimit
      - Rewrite IncrementQuotaUsed with atomic CTE SQL for 3-dimension update
      - Rewrite ResetQuotaUsed to clear all dimensions and period timestamps
      - Update postUsageBilling to use HasAnyQuotaLimit()
      - Preserve daily/weekly used values on account edit
      
      Frontend:
      - Refactor QuotaLimitCard from single v-model to 3-dimension props
      - Add QuotaBadge component for compact D/W/$ display
      - Update AccountCapacityCell with per-dimension badges
      - Update Create/Edit modals with daily/weekly quota fields
      - Update AccountActionMenu hasQuotaLimit to check all dimensions
      - Add i18n strings for daily/weekly/total quota labels
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      1ee17383
  9. 05 Mar, 2026 3 commits
    • erio's avatar
    • 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
  10. 02 Mar, 2026 1 commit
    • QTom's avatar
      feat(gateway): 双模式用户消息队列 — 串行队列 + 软性限速 · a9285b8a
      QTom authored
      新增 UMQ (User Message Queue) 双模式支持:
      - serialize: 账号级分布式串行锁 + RPM 自适应延迟(严格限流)
      - throttle: 仅 RPM 自适应前置延迟,不阻塞并发(软性限速)
      
      后端:
      - config: 新增 Mode 字段,保留 Enabled 向后兼容
      - service: 新增 UserMessageQueueService(Lua 锁/延迟算法/清理 worker)
      - repository: 新增 UserMsgQueueCache(Redis Lua acquire/release/force-release)
      - handler: 新增 UserMsgQueueHelper(SSE ping + 等待循环 + throttle)
      - gateway: 按 mode 分支集成 serialize/throttle 逻辑
      - lint: 修复 gofmt rewrite rules、errcheck 类型断言、staticcheck QF1012
      
      前端:
      - 三态选择器 UI(关闭/软性限速/串行队列)替代 toggle 开关
      - BulkEdit 支持 null 语义(不修改)
      - i18n 中英文文案
      
      通过 6 轮专家评审(42 次 review)、golangci-lint、单元测试、集成测试。
      a9285b8a
  11. 28 Feb, 2026 4 commits
    • QTom's avatar
      fix: round-3 review fixes for RPM limiting · 2491e9b5
      QTom authored
      - Add sanitizeExtraBaseRPM to BulkUpdate handler (was missing)
      - Add WindowCost scheduling checks to legacy non-sticky selection
        paths (4 sites), matching existing sticky + load-aware coverage
      - Export ParseExtraInt from service package, remove duplicate
        parseExtraIntForValidation from admin handler
      2491e9b5
    • QTom's avatar
      fix: address code review issues for RPM limiting feature · 60723757
      QTom authored
      - Use TxPipeline (MULTI/EXEC) instead of Pipeline for atomic INCR+EXPIRE
      - Filter negative values in GetBaseRPM(), update test expectation
      - Add RPM batch query (GetRPMBatch) to account List API
      - Add warn logs for RPM increment failures in gateway handler
      - Reset enableRpmLimit on BulkEditAccountModal close
      - Use union type 'tiered' | 'sticky_exempt' for rpmStrategy refs
      - Add design decision comments for rdb.Time() RTT trade-off
      60723757
    • QTom's avatar
    • yangjianbo's avatar
      feat(sync): full code sync from release · bb664d9b
      yangjianbo authored
      bb664d9b
  12. 24 Feb, 2026 2 commits
  13. 21 Feb, 2026 1 commit
    • yangjianbo's avatar
      feat(anthropic): 支持 API Key 自动透传并优化透传链路性能 · bde9dbc5
      yangjianbo authored
      - 新增 Anthropic API Key 自动透传开关与后端透传分支(仅替换认证)
      
      - 账号编辑页新增自动透传开关,默认关闭
      
      - 优化透传性能:SSE usage 解析 gjson 快路径、减少请求体重复拷贝、优化流式写回与非流式 usage 解析
      
      - 补充单元测试与 benchmark,确保 Claude OAuth 路径不受影响
      bde9dbc5
  14. 17 Feb, 2026 1 commit
  15. 12 Feb, 2026 2 commits
    • yangjianbo's avatar
      feat(openai): 增加 OAuth 账号 Codex 官方客户端限制开关 · a9518cc5
      yangjianbo authored
      
      
      新增 codex_cli_only 开关并默认关闭,关闭时完全绕过限制逻辑。
      在 OpenAI 网关引入统一检测入口,集中判定账号类型、开关与客户端族。
      开启后仅放行 codex_cli_rs、codex_vscode、codex_app 客户端家族。
      补充后端判定与网关分支测试,并在前端创建/编辑页增加开关配置与回显。
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      a9518cc5
    • yangjianbo's avatar
      feat(openai): 支持自动透传开关并透传 User-Agent · 9c910c20
      yangjianbo authored
      - OpenAI OAuth/API Key 统一支持自动透传开关,编辑页可开关\n- 透传模式仅替换认证并保留计费/并发/审计,修复 API Key responses 端点拼接\n- Usage 页面显示原始 User-Agent 且不截断,补充回归测试与清单
      9c910c20
  16. 10 Feb, 2026 1 commit
  17. 08 Feb, 2026 1 commit
    • erio's avatar
      refactor(upstream): replace upstream account type with apikey, auto-append /antigravity · fb58560d
      erio authored
      Upstream accounts now use the standard APIKey type instead of a dedicated
      upstream type. GetBaseURL() and new GetGeminiBaseURL() automatically append
      /antigravity for Antigravity platform APIKey accounts, eliminating the need
      for separate upstream forwarding methods.
      
      - Remove ForwardUpstream, ForwardUpstreamGemini, testUpstreamConnection
      - Remove upstream branch guards in Forward/ForwardGemini/TestConnection
      - Add migration 052 to convert existing upstream accounts to apikey
      - Update frontend CreateAccountModal to create apikey type
      - Add unit tests for GetBaseURL and GetGeminiBaseURL
      fb58560d
  18. 07 Feb, 2026 1 commit
    • erio's avatar
      feat(antigravity): comprehensive enhancements - model mapping, rate limiting, scheduling & ops · 5e98445b
      erio authored
      Key changes:
      - Upgrade model mapping: Opus 4.5 → Opus 4.6-thinking with precise matching
      - Unified rate limiting: scope-level → model-level with Redis snapshot sync
      - Load-balanced scheduling by call count with smart retry mechanism
      - Force cache billing support
      - Model identity injection in prompts with leak prevention
      - Thinking mode auto-handling (max_tokens/budget_tokens fix)
      - Frontend: whitelist mode toggle, model mapping validation, status indicators
      - Gemini session fallback with Redis Trie O(L) matching
      - Ops: enhanced concurrency monitoring, account availability, retry logic
      - Migration scripts: 049-051 for model mapping unification
      5e98445b
  19. 02 Feb, 2026 1 commit
  20. 22 Jan, 2026 1 commit
  21. 19 Jan, 2026 2 commits
    • shaw's avatar
      feat: 新增会话ID伪装功能,优化日志系统 · ccfeaeb2
      shaw authored
      - 新增 session_id_masking_enabled 配置,启用后将在15分钟内固定
        metadata.user_id 中的 session ID
      - TLS fingerprint 模块日志从自定义 debugLog 迁移到 slog
      - main.go 添加 slog 初始化,根据 gin mode 设置日志级别
      - 前端创建/编辑账号模态框添加会话ID伪装开关
      - 多语言支持(中英文)
      ccfeaeb2
    • shaw's avatar
      fix: 修复5小时窗口费用不重置的问题 · de6797c5
      shaw authored
      - 新增 GetCurrentWindowStartTime() 方法,当窗口过期时自动使用新的预测窗口开始时间
      - UpdateSessionWindow 更新窗口时间后触发 outbox 事件同步调度器缓存
      - 统一所有窗口费用查询入口使用新方法
      de6797c5
  22. 18 Jan, 2026 1 commit
  23. 16 Jan, 2026 2 commits
  24. 15 Jan, 2026 2 commits
  25. 14 Jan, 2026 1 commit
    • 墨颜's avatar
      feat(计费): 支持账号计费倍率快照与统计展示 · fb99ceac
      墨颜 authored
      - 新增 accounts.rate_multiplier(默认 1.0,允许 0)
      - 使用 usage_logs.account_rate_multiplier 记录倍率快照,避免历史回算
      - 统计/导出/管理端展示账号口径费用(total_cost * account_rate_multiplier)
      fb99ceac
  26. 07 Jan, 2026 1 commit