1. 05 Apr, 2026 4 commits
  2. 30 Mar, 2026 1 commit
  3. 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
  4. 24 Mar, 2026 1 commit
  5. 23 Mar, 2026 2 commits
  6. 19 Mar, 2026 2 commits
    • 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
    • Wang Lvyuan's avatar
  7. 17 Mar, 2026 3 commits
  8. 16 Mar, 2026 3 commits
    • Elysia's avatar
      fix(usage): use real reset header for session window instead of prediction · 668e1647
      Elysia authored
      
      
      The 5h window reset time displayed for Setup Token accounts was inaccurate
      because UpdateSessionWindow predicted the window end as "current hour + 5h"
      instead of reading the actual `anthropic-ratelimit-unified-5h-reset` response
      header. This caused the countdown to differ from the official Claude page.
      
      Backend: parse the reset header (Unix timestamp) and use it as the real
      window end, falling back to the hour-truncated prediction only when the
      header is absent. Also correct stale predictions when a subsequent request
      provides the real reset time.
      
      Frontend: add a reactive 60s timer so the reset countdown in
      UsageProgressBar ticks down in real-time instead of freezing at the
      initial value.
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      668e1647
    • Ethan0x0000's avatar
    • Ethan0x0000's avatar
      fix: always show usage stats for OpenAI OAuth and hide zero-value badges · 1acfc46f
      Ethan0x0000 authored
      - Simplify OpenAI rendering: always fetch /usage, prefer fetched data over
        codex snapshot (snapshot serves as loading placeholder only)
      - Remove dead code: preferFetchedOpenAIUsage, isOpenAICodexSnapshotStale,
        and unreachable template branch
      - Add today-stats support for key accounts (req/tokens/A/U badges)
      - Use formatCompactNumber for consistent number formatting
      - Add A/U badge titles for clarity
      - Filter zero-value window stats in UsageProgressBar to avoid empty badges
      - Update tests to match new fetched-data-first behavior
      1acfc46f
  9. 15 Mar, 2026 8 commits
    • erio's avatar
      refactor: replace sync.Map credits state with AICredits rate limit key · 8a260def
      erio authored
      Replace process-memory sync.Map + per-model runtime state with a single
      "AICredits" key in model_rate_limits, making credits exhaustion fully
      isomorphic with model-level rate limiting.
      
      Scheduler: rate-limited accounts with overages enabled + credits available
      are now scheduled instead of excluded.
      
      Forwarding: when model is rate-limited + credits available, inject credits
      proactively without waiting for a 429 round trip.
      
      Storage: credits exhaustion stored as model_rate_limits["AICredits"] with
      5h duration, reusing SetModelRateLimit/isRateLimitActiveForKey.
      
      Frontend: show credits_active (yellow ) when model rate-limited but
      credits available, credits_exhausted (red) when AICredits key active.
      
      Tests: add unit tests for shouldMarkCreditsExhausted, injectEnabledCreditTypes,
      clearCreditsExhausted, and update existing overages tests.
      8a260def
    • SilentFlower's avatar
    • SilentFlower's avatar
    • SilentFlower's avatar
    • SilentFlower's avatar
      feat: implement resolveCreditsOveragesModelKey function to stabilize model key... · 17e40333
      SilentFlower authored
      feat: implement resolveCreditsOveragesModelKey function to stabilize model key resolution for credit overages
      17e40333
    • shaw's avatar
      fix: 恢复 UsageProgressBar 中被意外移除的窗口统计数据展示 · 220fbe65
      shaw authored
      commit 0debe0a8 在修复 OpenAI WS 用量窗口刷新问题时,意外删除了
      UsageProgressBar 中的 window stats 渲染逻辑和格式化函数。
      
      恢复进度条上方的统计行(requests, tokens, account cost, user cost)
      及对应的 4 个格式化 computed 属性。
      220fbe65
    • IanShaw027's avatar
      fix: 修复批量编辑账号时模型白名单显示与实际不一致的问题 #982 · 19d3ecc7
      IanShaw027 authored
      修复批量编辑账号时,UI 显示的是 plain 模型名(如 GPT-5),但实际落库的是 dated 模型名的问题。
      
      核心改动:
      1. 批量编辑白名单不再使用 BulkEditAccountModal.vue 中手写的过期模型列表
         - 移除了 allModels 和 presetMappings 的硬编码列表(共 200+ 行)
         - 直接复用 ModelWhitelistSelector.vue 组件
      
      2. ModelWhitelistSelector 组件支持多平台联合过滤
         - 新增 platforms 属性支持传入多个平台
         - 添加 normalizedPlatforms 计算属性统一处理单平台和多平台场景
         - availableOptions 根据选中的多个平台动态联合过滤模型列表
         - fillRelated 功能支持一次性填充多个平台的相关模型
      
      3. 模型映射预设改为动态生成
         - filteredPresets 改用 getPresetMappingsByPlatform 从统一模型源按平台动态生成
         - 不再依赖弹窗中的手写预设列表
      
      现在的行为:
      - UI 显示什么模型,勾选什么模型,传给后端的就是什么模型
      - 彻底解决了批量编辑链路上"显示与实际不一致"的问题
      - 模型列表和映射预设始终与系统定义保持同步
      19d3ecc7
    • Ethan0x0000's avatar
      feat: 完善使用记录端点可观测性与分布统计 · eefab159
      Ethan0x0000 authored
      将入站、上游与路径三类端点分布统一到使用记录页的一致化卡片交互中,并补齐端点元数据与统计链路,提升排障与流量分析效率。
      eefab159
  10. 14 Mar, 2026 1 commit
    • 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
  11. 13 Mar, 2026 3 commits
    • erio's avatar
      feat(antigravity): add 403 forbidden status detection, classification and display · 6344fa2a
      erio authored
      Backend:
      - Detect and classify 403 responses into three types:
        validation (account needs Google verification),
        violation (terms of service / banned),
        forbidden (generic 403)
      - Extract verification/appeal URLs from 403 response body
        (structured JSON parsing with regex fallback)
      - Add needs_verify, is_banned, needs_reauth, error_code fields
        to UsageInfo (omitempty for zero impact on other platforms)
      - Handle 403 in request path: classify and permanently set account error
      - Save validation_url in error_message for degraded path recovery
      - Enrich usage with account error on both success and degraded paths
      - Add singleflight dedup for usage requests with independent context
      - Differentiate cache TTL: success/403 → 3min, errors → 1min
      - Return degraded UsageInfo instead of HTTP 500 on quota fetch errors
      
      Frontend:
      - Display forbidden status badges with color coding (red for banned,
        amber for needs verification, gray for generic)
      - Show clickable verification/appeal URL links
      - Display needs_reauth and degraded error states in usage cell
      - Add Antigravity tier label badge next to platform type
      
      Tests:
      - Comprehensive unit tests for classifyForbiddenType (7 cases)
      - Unit tests for extractValidationURL (8 cases including unicode escapes)
      - Integration test for FetchQuota forbidden path
      6344fa2a
    • Ylarod's avatar
      sub2api: add bedrock support · 11f7b835
      Ylarod authored
      11f7b835
    • 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
  12. 11 Mar, 2026 3 commits
  13. 09 Mar, 2026 1 commit
  14. 08 Mar, 2026 2 commits
  15. 07 Mar, 2026 5 commits
    • kyx236's avatar
      feat(admin): 支持定时测试自动恢复并统一账号恢复入口 · 0c29468f
      kyx236 authored
      - 为定时测试计划增加 auto_recover 配置,补齐前后端类型、接口、仓储与数据库迁移
      - 在定时测试成功后自动恢复账号 error、rate-limit 等可恢复运行时状态
      - 新增 /admin/accounts/:id/recover-state 接口,合并原有重置状态与清限流操作
      - 更新账号管理菜单与定时测试面板,补充自动恢复开关、说明提示和状态展示
      - 补充账号恢复、限流清理与仓储同步相关测试
      0c29468f
    • 神乐's avatar
      fix: 修复 OpenAI WS 用量刷新遗漏场景 · 9301dae6
      神乐 authored
      9301dae6
    • 神乐's avatar
      101ef0cf
    • 神乐's avatar
      0debe0a8
    • 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