erio
cdddbec629
chore: bump version to 0.1.96.1
2026-03-12 18:13:28 +08:00
erio
5f6e929d61
chore: bump version to 0.1.95.1
2026-03-11 03:24:05 +08:00
erio
4caa3c2701
merge: integrate upstream v0.1.95 with our customizations
...
Merge main (custom features) into release/custom-0.1.95 (upstream v0.1.95).
New upstream features: group subscription binding, multi-dimension quota (daily/weekly/total),
allow_messages_dispatch, default_mapped_model, recover state API.
Our customizations: simulate_claude_max_enabled, usage status detection, 403 validation handling.
2026-03-11 03:23:44 +08:00
Wesley Liddick
3cc407bc0e
Merge pull request #900 from ischanx/feat/admin-bind-subscription-group
...
feat: 允许管理员为持有有效订阅的用户绑定订阅类型分组
2026-03-10 11:20:47 +08:00
Wesley Liddick
ac6bde7a98
Merge pull request #872 from StarryKira/fix/oauth-linuxdo-invitation-required
...
fix: Linux.do OAuth 注册支持邀请码两步流程 (fix #836 )
2026-03-10 09:10:35 +08:00
ischanx
767a41e263
feat: 允许管理员为持有有效订阅的用户绑定订阅类型分组
...
之前管理员无法通过 API 密钥管理将用户绑定到订阅类型分组(直接返回错误)。
现在改为检查用户是否持有该分组的有效订阅,有则允许绑定,无则拒绝。
- admin_service: 新增 userSubRepo 依赖,替换硬拒绝为订阅校验
- admin_service: 区分 ErrSubscriptionNotFound 和内部错误,避免 DB 故障被误报
- wire_gen/api_contract_test: 同步新增参数
- UserApiKeysModal: 管理员分组下拉不再过滤订阅类型分组
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-10 00:51:43 +08:00
Elysia
106b20cdbf
fix claudecode review bug
2026-03-09 01:18:49 +08:00
kyx236
0c29468f90
feat(admin): 支持定时测试自动恢复并统一账号恢复入口
...
- 为定时测试计划增加 auto_recover 配置,补齐前后端类型、接口、仓储与数据库迁移
- 在定时测试成功后自动恢复账号 error、rate-limit 等可恢复运行时状态
- 新增 /admin/accounts/:id/recover-state 接口,合并原有重置状态与清限流操作
- 更新账号管理菜单与定时测试面板,补充自动恢复开关、说明提示和状态展示
- 补充账号恢复、限流清理与仓储同步相关测试
2026-03-08 06:59:53 +08:00
shaw
a3791104f9
feat: 支持后台设置是否启用整流开关
2026-03-07 21:55:38 +08:00
yangjianbo
a18bbb5f2f
fix(openai): 统一专属倍率计费链路并补齐回归测试
...
抽取共享的用户分组专属倍率解析器,统一缓存、singleflight 与回退逻辑。\n\n让 OpenAI 独立计费链路复用专属倍率解析,修复 usage 记录与实际扣费未命中用户专属倍率的问题。\n\n补齐 OpenAI 计费与解析器单元测试,并修复全量回归中暴露的 lint 阻塞项。\n\nCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-06 16:47:51 +08:00
erio
a9ecd7bcc6
chore: bump version to 0.1.91.1
2026-03-06 04:08:37 +08:00
erio
f89465fb39
Merge branch 'main' into release/custom-0.1.91
...
# Conflicts:
# frontend/src/components/admin/account/AccountActionMenu.vue
# frontend/src/views/admin/AccountsView.vue
2026-03-06 04:08:14 +08:00
erio
440c3f46a7
feat: add independent load_factor field for scheduling load calculation
...
- Separate load factor from concurrency: concurrency controls actual
slot acquisition, load_factor controls load rate calculation
- Add EffectiveLoadFactor() method: LoadFactor > Concurrency > 1
- Add load_factor field to Create/Edit/BulkEdit account forms
- Fix RPM default value: auto-fill 15 when RPM enabled but not set
- Fix stale test compilation errors in server and handler packages
2026-03-06 03:42:24 +08:00
erio
c746964936
chore: bump version to 0.1.90.8
2026-03-06 01:16:40 +08:00
erio
ce4095904e
chore: bump version to 0.1.90.7
2026-03-05 22:56:20 +08:00
erio
02dca78dbe
refactor: extract QuotaLimitCard component for reuse in create and edit modals
...
- Extract quota limit card/toggle UI into QuotaLimitCard.vue component
- Use v-model pattern for clean parent-child data flow
- Integrate into both EditAccountModal and CreateAccountModal
- All apikey accounts (all platforms) now support quota limit on creation
- Bump version to 0.1.90.6
2026-03-05 22:13:56 +08:00
erio
8df299b767
feat: restyle API Key quota limit UI to card/toggle format
...
- Redesign quota limit section with card layout and toggle switch
- Add watch to clear quota value when toggle is disabled
- Add i18n keys for toggle labels and hints (zh/en)
- Bump version to 0.1.90.5
2026-03-05 22:01:40 +08:00
erio
99331a5285
fix: throttle Anthropic usage queries and pass through upstream HTTP errors
...
- Frontend: queue Anthropic OAuth/setup-token usage requests by proxy
with random 1-1.5s interval to prevent upstream 429
- Backend: return ApplicationError with actual upstream status code
instead of wrapping all errors as 500
- Handle component unmount to skip stale updates on page navigation
2026-03-05 19:12:49 +08:00
guoyongchang
817a491087
simplify: 移除 leader lock,单实例无需分布式锁
...
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-05 16:31:27 +08:00
guoyongchang
9a8dacc514
fix: 修复 golangci-lint depguard 和 gofmt 错误
...
将 redis leader lock 逻辑从 service 层抽取为 LeaderLocker 接口,
实现移至 repository 层,消除 service 层对 redis 的直接依赖。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-05 16:28:48 +08:00
guoyongchang
8adf80d98b
fix: wire_gen_test 补充 scheduledTestRunner 参数
...
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-05 16:23:41 +08:00
guoyongchang
3a089242f8
feat: 支持基于 crontab 的定时账号测试
...
每个测试计划绑定一个账号和一个模型,按 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: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-05 16:06:05 +08:00
erio
9245e197a8
chore: bump version to 0.1.90.3
2026-03-04 21:50:33 +08:00
erio
0bb683a6f1
chore: bump version to 0.1.90.2
2026-03-04 21:33:39 +08:00
erio
a6026e7ac4
Merge tag 'v0.1.90' into merge/upstream-v0.1.90
...
注册邮箱域名白名单策略上线,后台大数据场景性能大幅优化。
- 注册邮箱域名白名单:支持管理员配置允许注册的邮箱域名策略
- Keys 页面表单筛选:用户 /keys 页面支持按条件筛选 API Key
- Settings 页面分 Tab 拆分:管理后台设置页面按功能模块分 Tab 展示
- 后台大数据场景加载性能优化:仪表盘/用户/账号/Ops 页面大数据集加载显著提速
- Usage 大表分页优化:默认避免全量 COUNT(*),大幅降低分页查询耗时
- 消除重复的 normalizeAccountIDList,补充新增组件的单元测试
- 清理无用文件和过时文档,精简项目结构
- EmailVerifyView 硬编码英文字符串替换为 i18n 调用
- 修复 Anthropic 平台无限流重置时间的 429 误标记账号限流问题
- 修复自定义菜单页面管理员视角菜单不生效问题
- 修复 Ops 错误详情弹窗未展示真实上游 payload 的问题
- 修复充值/订阅菜单 icon 显示问题
# Conflicts:
# .gitignore
# backend/cmd/server/VERSION
# backend/ent/group.go
# backend/ent/runtime/runtime.go
# backend/ent/schema/group.go
# backend/go.sum
# backend/internal/handler/admin/account_handler.go
# backend/internal/handler/admin/dashboard_handler.go
# backend/internal/pkg/usagestats/usage_log_types.go
# backend/internal/repository/group_repo.go
# backend/internal/repository/usage_log_repo.go
# backend/internal/server/middleware/security_headers.go
# backend/internal/server/router.go
# backend/internal/service/account_usage_service.go
# backend/internal/service/admin_service_bulk_update_test.go
# backend/internal/service/dashboard_service.go
# backend/internal/service/gateway_service.go
# frontend/src/api/admin/dashboard.ts
# frontend/src/components/account/BulkEditAccountModal.vue
# frontend/src/components/charts/GroupDistributionChart.vue
# frontend/src/components/layout/AppSidebar.vue
# frontend/src/i18n/locales/en.ts
# frontend/src/i18n/locales/zh.ts
# frontend/src/views/admin/GroupsView.vue
# frontend/src/views/admin/SettingsView.vue
# frontend/src/views/admin/UsageView.vue
# frontend/src/views/user/PurchaseSubscriptionView.vue
2026-03-04 19:58:38 +08:00
shaw
ccf6a921c7
fix: 修复 PR #723 引入的 CI lint 和 test 编译错误
...
- wire_gen_test.go: 补充 NewTokenRefreshService 缺失的 tempUnschedCache 参数
- config.go, token_refresh_service.go: 修复 gofmt 格式问题
2026-03-03 16:45:29 +08:00
Wesley Liddick
197c570baa
Merge pull request #723 from zqq-nuli/fix/oauth-401-temp-unschedulable
...
fix: OAuth 401 不再永久锁死账号,改用临时不可调度实现自动恢复
2026-03-03 16:33:07 +08:00
shaw
a80ec5d8bb
feat: apikey支持5h/1d/7d速率控制
2026-03-03 15:01:10 +08:00
Wesley Liddick
b7df7ce5d5
Merge pull request #726 from DaydreamCoding/feat/dual-mode-umq
...
feat(gateway): 双模式用户消息队列 — 串行队列 + 软性限速
2026-03-03 08:41:34 +08:00
erio
50a8116ae9
fix: update SecurityHeaders call sites to match new signature
2026-03-03 06:37:50 +08:00
QTom
a9285b8a94
feat(gateway): 双模式用户消息队列 — 串行队列 + 软性限速
...
新增 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、单元测试、集成测试。
2026-03-03 01:05:11 +08:00
zqq61
ec6bcfeb83
fix: OAuth 401 不再永久锁死账号,改用临时不可调度实现自动恢复
...
OAuth 账号收到 401 时,原逻辑同时设置 expires_at=now() 和 SetError(),
但刷新服务只查询 status=active 的账号,导致 error 状态的账号永远无法
被刷新服务拾取,expires_at=now() 实际上是死代码。
修复:
- OAuth 401 使用 SetTempUnschedulable 替代 SetError,保持 status=active
- 新增 oauth_401_cooldown_minutes 配置项(默认 10 分钟)
- 刷新成功后同步清除 DB 和 Redis 中的临时不可调度状态
- 不可重试错误检查(invalid_grant 等)从 Antigravity 推广到所有平台
- 可重试错误耗尽后不再标记 error,下个刷新周期继续重试
恢复流程:
OAuth 401 → temp_unschedulable + expires_at=now → 刷新服务拾取
→ 成功: 清除 temp_unschedulable → 自动恢复
→ invalid_grant: SetError → 永久禁用
→ 网络错误: 仅记日志 → 下周期重试
2026-03-02 22:54:38 +08:00
PMExtra
7e02082209
feat(settings): add default subscriptions for new users
...
- add default subscriptions to admin settings
- auto-assign subscriptions on register and admin user creation
- add validation/tests and align settings UI with subscription selector patterns
2026-03-02 03:59:31 +08:00
erio
1e03b2974a
chore: bump version to 0.1.87.18
2026-03-02 01:23:12 +08:00
erio
8a82a2a648
feat(csp): auto-inject purchase_subscription_url origin into frame-src
2026-03-02 00:19:25 +08:00
erio
c3ac68af2a
chore: bump version to 0.1.87.16
2026-03-01 20:14:48 +08:00
erio
62486cee37
chore: bump version to 0.1.87.15
2026-03-01 19:49:12 +08:00
Wesley Liddick
8c4d22b3f9
Merge pull request #685 from touwaeriol/pr/admin-create-and-redeem-docs
...
feat(admin): add create-and-redeem endpoint for payment integrations
2026-03-01 18:24:15 +08:00
erio
47f7b0213b
chore: bump version to 0.1.87.14
2026-03-01 18:16:41 +08:00
erio
81903e87e3
chore: bump version to 0.1.87.13
2026-03-01 16:37:12 +08:00
erio
34ccfe45ea
chore: bump version to 0.1.87.12
2026-03-01 15:59:29 +08:00
QTom
4280aca82c
feat(gateway): 添加 Claude Code 客户端最低版本检查功能
...
- 通过 User-Agent 识别 Claude Code 客户端并提取版本号
- 在网关层验证客户端版本是否满足管理员配置的最低要求
- 在管理后台提供版本要求配置选项(英文/中文双语)
- 实现原子缓存 + singleflight 防止并发问题和 thundering herd
- 使用 context.WithoutCancel 隔离 DB 查询,避免客户端断连影响缓存
- 双 TTL 策略:60s 正常、5s 错误恢复,保证性能与可用性
- 仅检查 Claude Code 客户端,其他客户端不受影响
- 添加完整单元测试覆盖版本提取、比对、上下文操作
2026-03-01 15:45:44 +08:00
erio
336a844712
chore: bump version to 0.1.87.11
2026-03-01 13:02:24 +08:00
erio
4d88248091
chore: bump version to 0.1.87.10
2026-03-01 12:46:42 +08:00
erio
05c2a65ef0
chore: bump version to 0.1.87.9
2026-03-01 12:37:07 +08:00
erio
87bd765a57
chore: bump version to 0.1.87.8
2026-03-01 01:02:53 +08:00
erio
39ca192c41
feat(admin): add create-and-redeem API and payment integration docs
2026-03-01 00:42:21 +08:00
erio
238d86f502
feat(admin): add create-and-redeem API and payment integration docs
2026-03-01 00:41:38 +08:00
Wesley Liddick
9fd95df5cf
Merge pull request #679 from DaydreamCoding/feat/account-rpm-limit
...
feat: 添加账号级别 RPM(每分钟请求数)限流功能
2026-02-28 22:37:10 +08:00
Wesley Liddick
4587c3e53e
Merge pull request #670 from DaydreamCoding/feat/admin-apikey-group-update
...
feat(admin): 添加管理员直接修改用户 API Key 分组的功能
2026-02-28 22:20:29 +08:00