1. 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
  2. 12 Mar, 2026 1 commit
    • erio's avatar
      feat(groups): add rate multipliers management modal · d6488112
      erio authored
      Add a dedicated modal in group management for viewing, adding, editing,
      and deleting per-user rate multipliers within a group.
      
      Backend:
      - GET /admin/groups/:id/rate-multipliers - list entries with user details
      - PUT /admin/groups/:id/rate-multipliers - batch sync (full replace)
      - DELETE /admin/groups/:id/rate-multipliers - clear all entries
      - Repository: GetByGroupID, SyncGroupRateMultipliers methods on
        user_group_rate_multipliers table (same table as user-side rates)
      
      Frontend:
      - New GroupRateMultipliersModal component with:
        - User search and add with email autocomplete
        - Editable rate column with local edit mode (cancel/save)
        - Batch adjust: multiply all rates by a factor
        - Clear all (local operation, requires save to persist)
        - Pagination (10/20/50 per page)
        - Platform icon with brand colors in group info bar
        - Unsaved changes indicator with revert option
      - Unit tests for all three backend endpoints
      d6488112
  3. 11 Mar, 2026 2 commits
  4. 09 Mar, 2026 3 commits
    • ischanx's avatar
      feat: 允许管理员为持有有效订阅的用户绑定订阅类型分组 · 767a41e2
      ischanx authored
      
      
      之前管理员无法通过 API 密钥管理将用户绑定到订阅类型分组(直接返回错误)。
      现在改为检查用户是否持有该分组的有效订阅,有则允许绑定,无则拒绝。
      
      - admin_service: 新增 userSubRepo 依赖,替换硬拒绝为订阅校验
      - admin_service: 区分 ErrSubscriptionNotFound 和内部错误,避免 DB 故障被误报
      - wire_gen/api_contract_test: 同步新增参数
      - UserApiKeysModal: 管理员分组下拉不再过滤订阅类型分组
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      767a41e2
    • QTom's avatar
      feat: 支持批量重置状态和批量刷新令牌 · 252d6c53
      QTom authored
      - 提取 refreshSingleAccount 私有方法复用单账号刷新逻辑
      - 新增 BatchClearError handler (POST /admin/accounts/batch-clear-error)
      - 新增 BatchRefresh handler (POST /admin/accounts/batch-refresh)
      - 前端 AccountBulkActionsBar 添加批量重置状态/刷新令牌按钮
      - AccountsView 添加 handler 支持 partial success 反馈
      - i18n 中英文补充批量操作相关翻译
      252d6c53
    • yangjianbo's avatar
      fix(billing): 修复 OpenAI fast 档位计费并补齐展示 · 87f4ed59
      yangjianbo authored
      
      
      - 打通 service_tier 在 OpenAI HTTP、WS、passthrough 与 usage 记录中的传递
      - 修正 priority/flex 计费逻辑,并将 fast 归一化为 priority
      - 在用户端和管理端补齐服务档位与计费明细展示
      - 补齐前后端测试,并修复 WS 限流信号重复持久化导致的全量回归失败
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      87f4ed59
  5. 08 Mar, 2026 1 commit
    • bayma888's avatar
      feat(ui): 使用记录页面点击用户邮箱可查看充值记录 · 60c5949a
      bayma888 authored
      - UsageTable 用户邮箱改为可点击链接,点击弹出余额变动记录
      - 复用 UserBalanceHistoryModal 组件,通过 getById API 获取完整用户信息
      - 新增 hideActions prop 隐藏充值/退款按钮(Usage 页面仅查看)
      - i18n: 新增 clickToViewBalance、failedToLoadUser 词条 (en/zh)
      60c5949a
  6. 07 Mar, 2026 2 commits
    • kyx236's avatar
      feat(admin): 支持定时测试自动恢复并统一账号恢复入口 · 0c29468f
      kyx236 authored
      - 为定时测试计划增加 auto_recover 配置,补齐前后端类型、接口、仓储与数据库迁移
      - 在定时测试成功后自动恢复账号 error、rate-limit 等可恢复运行时状态
      - 新增 /admin/accounts/:id/recover-state 接口,合并原有重置状态与清限流操作
      - 更新账号管理菜单与定时测试面板,补充自动恢复开关、说明提示和状态展示
      - 补充账号恢复、限流清理与仓储同步相关测试
      0c29468f
    • 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
  7. 05 Mar, 2026 3 commits
    • 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
    • guoyongchang's avatar
      refactor: 移除冗余中间类型和不必要代码 · 831abf79
      guoyongchang authored
      
      
      - 移除 ScheduledTestOutcome 中间类型,RunTestBackground 直接返回 *ScheduledTestResult
      - 简化 SaveResult 直接接受 *ScheduledTestResult
      - 移除 handler 中不必要的 nil 检查
      - 移除前端 ScheduledTestsPanel 中多余的 String() 转换
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      831abf79
    • guoyongchang's avatar
      feat: 支持基于 crontab 的定时账号测试 · 3a089242
      guoyongchang authored
      
      
      每个测试计划绑定一个账号和一个模型,按 cron 表达式定期执行测试,
      保存历史结果并在前端账号管理页面中提供完整的增删改查和结果查看功能。
      
      主要变更:
      - 新增 scheduled_test_plans / scheduled_test_results 两张表及迁移
      - 后端 service 层:CRUD 服务 + 后台 cron runner(每分钟扫描到期计划并发执行)
      - RunTestBackground 方法通过 httptest 在内存中执行账号测试并解析 SSE 输出
      - Redis leader lock + pg_try_advisory_lock 双重保障多实例部署只执行一次
      - REST API:5 个管理端点(计划 CRUD + 结果查询)
      - 前端 ScheduledTestsPanel 组件:计划管理、启用开关、内联编辑、结果展开查看
      - 中英文 i18n 支持
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      3a089242
  8. 04 Mar, 2026 1 commit
    • kyx236's avatar
      feat: 二次 401 直接升级为错误状态,添加 DB 回退确保生效 · 6aa8cbbf
      kyx236 authored
      账号首次 401 仅临时不可调度,给予 token 刷新窗口;若恢复后再次 401
      说明凭证确实失效,直接升级为错误状态以避免反复无效调度。
      
      - 缓存中 reason 为空时从 DB 回退读取,防止升级判断失效
      - ClearError 同时清除临时不可调度状态,管理员恢复后重新给予一次机会
      - 管理后台账号列表添加"临时不可调度"状态筛选
      - 补充 DB 回退场景单元测试
      6aa8cbbf
  9. 28 Feb, 2026 3 commits
    • QTom's avatar
      feat(admin): 完整实现管理员修改用户 API Key 分组的功能 · 9a91815b
      QTom authored
      ## 核心功能
      - 添加 AdminUpdateAPIKeyGroupID 服务方法,支持绑定/解绑/保持不变三态语义
      - 实现 UserRepository.AddGroupToAllowedGroups 接口,自动同步专属分组权限
      - 添加 HTTP PUT /api-keys/:id handler 端点,支持管理员直接修改 API Key 分组
      
      ## 事务一致性
      - 使用 ent Tx 保证专属分组绑定时「添加权限」和「更新 Key」的原子性
      - Repository 方法支持 clientFromContext,兼容事务内调用
      - 事务失败时自动回滚,避免权限孤立
      
      ## 业务逻辑
      - 订阅类型分组阻断,需通过订阅管理流程
      - 非活跃分组拒绝绑定
      - 负 ID 和非法 ID 验证
      - 自动授权响应,告知管理员成功授权的分组
      
      ## 代码质量
      - 16 个单元测试覆盖所有业务路径和边界用例
      - 7 个 handler 集成测试覆盖 HTTP 层
      - GroupRepo stub 返回克隆副本,防止测试间数据泄漏
      - API 类型安全修复(PaginatedResponse<ApiKey>)
      - 前端 ref 回调类型对齐 Vue 规范
      
      ## 国际化支持
      - 中英文提示信息完整
      - 自动授权成功/失败提示
      9a91815b
    • QTom's avatar
      feat(admin): 添加管理员直接修改用户 API Key 分组的功能 · 000e621e
      QTom authored
      - 新增 PUT /api/v1/admin/api-keys/:id 端点,允许管理员修改任意用户 API Key 的分组绑定
      - 跳过用户级权限校验但保留分组有效性验证,修改后触发认证缓存失效
      - Service 层支持三态语义:nil=不修改,0=解绑,>0=绑定,<0=拒绝
      - 指针值拷贝保证安全隔离,负数 groupID 返回 400 INVALID_GROUP_ID
      - 前端 UserApiKeysModal 新增可点击的分组选择下拉框,支持多 Key 并发更新
      - 下拉支持视口翻转和滚动关闭,按钮有 disabled 和加载状态
      - 覆盖:后端 20 个单元测试 (Service 11 + Handler 9) + 前端 16 个 E2E 测试
      - golangci-lint 0 issues, make test-unit 全部通过
      000e621e
    • yangjianbo's avatar
      feat(sync): full code sync from release · bb664d9b
      yangjianbo authored
      bb664d9b
  10. 27 Feb, 2026 1 commit
  11. 23 Feb, 2026 1 commit
  12. 19 Feb, 2026 2 commits
  13. 17 Feb, 2026 1 commit
  14. 14 Feb, 2026 3 commits
    • shaw's avatar
      feat: 区分 Anthropic 5m/1h 缓存创建 token 的差异化计费 · a817cafe
      shaw authored
      Anthropic API 的 cache_creation 对象区分了 ephemeral_5m 和 ephemeral_1h
      两种缓存创建 token,1h 单价远高于 5m(如 claude-3-5-haiku: 5m=$1/MTok,
      1h=$6/MTok)。此前系统统一按 5m 单价计费,导致计费偏低。
      
      后端:
      - pricing_service: 加载 LiteLLM 的 cache_creation_input_token_cost_above_1hr
      - billing_service: GetModelPricing 启用分类计费(安全守卫 1h>5m),
        CalculateCost 按 5m/1h 分别计费,无明细时回退到 5m 单价
      - gateway_service: parseSSEUsage/handleNonStreamingResponse 用 gjson
        提取嵌套 cache_creation 对象的 ephemeral_5m/1h_input_tokens
      - antigravity_gateway_service: extractSSEUsage/extractClaudeUsage 同步提取
      - usage_log: 修复 GORM column tag 确保写入正确的数据库列
      - 新增迁移 054: 删除 GORM 自动生成的重复列
      
      前端:
      - 使用记录 tooltip 展示 5m/1h 缓存创建明细(带彩色 badge 区分)
      - 表格单元格缓存写入数值旁显示 1h 标识
      a817cafe
    • yangjianbo's avatar
      fix(accounts): 账号管理改为单行增量更新并避免全量刷新 · 9cafa46d
      yangjianbo authored
      
      
      - 将编辑与重新授权成功事件改为回传更新后的账号对象
      - 在账号列表页按 id 就地补丁更新单行数据并保留运行时容量字段
      - 单账号操作(刷新凭证/清错/清限流/临时不可调度重置)改为单行更新
      - 后端增强 clear-rate-limit 接口,返回更新后的账号对象
      - 同步前端 clearRateLimit API 类型定义
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      9cafa46d
    • yangjianbo's avatar
  15. 12 Feb, 2026 1 commit
    • yangjianbo's avatar
      feat(openai): 支持自动透传开关并透传 User-Agent · 9c910c20
      yangjianbo authored
      - OpenAI OAuth/API Key 统一支持自动透传开关,编辑页可开关\n- 透传模式仅替换认证并保留计费/并发/审计,修复 API Key responses 端点拼接\n- Usage 页面显示原始 User-Agent 且不截断,补充回归测试与清单
      9c910c20
  16. 11 Feb, 2026 2 commits
    • kyx236's avatar
      feat(admin): Add group filtering for account listings · fe1d46a8
      kyx236 authored
      - Add groupID parameter to ListAccounts and ListWithFilters methods
      - Implement account filtering by group ID in repository query
      - Add group query parameter parsing in account handler
      - Update all ListAccounts/ListWithFilters call sites with groupID parameter
      - Add group filter UI component to AccountTableFilters
      - Add i18n translations for group filter label in English and Chinese
      - Update API contract and test stubs to reflect new signature
      - Enable filtering accounts by their assigned groups in admin panel
      fe1d46a8
    • kyx236's avatar
      feat(admin): Add email search and rate limit filtering for accounts and redeem codes · 04a1a7c2
      kyx236 authored
      - Add used_by_email column to redeem code export CSV for better user identification
      - Implement rate_limited status filter in account listing with RateLimitResetAt check
      - Extend redeem code search to include user email in addition to code matching
      - Add API key search capability to user listing filters
      - Display user email in redeem code table used_by column for improved visibility
      - Update search placeholders in UI to reflect expanded search capabilities (email, username, notes, API key)
      - Improve Chinese and English localization strings for search hints
      04a1a7c2
  17. 10 Feb, 2026 1 commit
  18. 09 Feb, 2026 1 commit
  19. 07 Feb, 2026 1 commit
  20. 05 Feb, 2026 5 commits
  21. 03 Feb, 2026 1 commit
  22. 02 Feb, 2026 3 commits
    • bayma888's avatar
      feat(admin): add user balance/concurrency history modal · 606e29d3
      bayma888 authored
      - Add new API endpoint GET /admin/users/:id/balance-history with pagination and type filter
      - Add SumPositiveBalanceByUser for calculating total recharged amount
      - Create UserBalanceHistoryModal component with:
        - User info header (email, username, created_at, current balance, notes, total recharged)
        - Type filter dropdown (all/balance/admin_balance/concurrency/admin_concurrency/subscription)
        - Quick deposit/withdraw buttons
        - Paginated history list with icons and colored values
      - Add instant tooltip on balance column for better UX
      - Add z-index prop to BaseDialog for modal stacking control
      - Update i18n translations (zh/en)
      606e29d3
    • song's avatar
      merge upstream main · 0170d19f
      song authored
      0170d19f
    • shaw's avatar
      feat: 重新设计公告系统为Header铃铛通知 · bbdc8663
      shaw authored
      - 新增 AnnouncementBell 组件,支持 Modal 弹窗和 Markdown 渲染
      - 移除 Dashboard 横幅和独立公告页面
      - 铃铛位置在 Header 文档按钮左侧,显示未读红点
      - 支持点击查看详情、标记已读、全部已读等操作
      - 完善国际化,移除所有硬编码中文
      - 修复 AnnouncementTargetingEditor watch 循环问题
      bbdc8663