Commit Graph
301 Commits
Author SHA1 Message Date
erioandClaude Opus 4.6 e951651ee8 chore: bump version to 0.1.93.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:14:14 +08:00
erioandClaude Opus 4.6 7f3bf571da chore: bump version to 0.1.93.3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:59:51 +08:00
erioandClaude Opus 4.6 2b510b6aed chore: bump version to 0.1.93.2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:19:23 +08:00
erioandClaude Opus 4.6 8c412b32d1 feat: add Sora async task API (videos/images)
Add async task management for Sora video/image generation with two
forwarding modes: OAuth (SDK) and API Key (HTTP upstream). Includes
background worker for status polling and 3-layer storage degradation
(S3 > local disk > upstream URL passthrough).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:19:11 +08:00
erioandClaude Opus 4.6 4fb58c66c4 chore: bump version to 0.1.93.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:36:25 +08:00
erioandClaude Opus 4.6 146f0baebc chore: bump version to 0.1.92.19
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:31:01 +08:00
erioandClaude Opus 4.6 3998e58b53 chore: bump version to 0.1.92.18
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:20:55 +08:00
erioandClaude Opus 4.6 56c2799293 chore: bump version to 0.1.92.17
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:56:40 +08:00
erio 1d4e1feb93 chore: bump version to 0.1.92.16 2026-03-07 14:34:08 +08:00
erio 5f5c41cef6 chore: bump version to 0.1.92.15 2026-03-07 12:53:29 +08:00
erioandClaude Opus 4.6 1864f41f33 merge: sync upstream/main into release/custom-0.1.92
Merge upstream main branch changes including:
- OpenAI Codex support and websearch adaptation
- API key rate limit auto-reset fix
- golangci-lint v2.11 upgrade for Go 1.26 compatibility
- Go 1.26.1 stdlib security fixes
- Empty stream failover fix
- CCSwitch import improvements
- API key credentials preserve existing fields
- Usage query rate limit optimization
- Setup Token real utilization fix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:53:12 +08:00
erio fcdd34ddb0 chore: bump version to 0.1.92.14 2026-03-07 12:34:48 +08:00
erio 98abcb30e4 chore: bump version to 0.1.92.13 2026-03-07 12:12:11 +08:00
erio ca5b3e6f7a chore: bump version to 0.1.92.12 2026-03-07 05:41:32 +08:00
erioandClaude Opus 4.6 ea5e5dd9c7 feat: display client affinity count badge in account status column
Add colored circle badge showing affinity client count before the account
status indicator. Badge color reflects count severity (gray=0, green=1-5,
yellow=6-15, red=16+). Tooltip shows full client ID list on hover.

Backend: AccountHandler batch queries reverse affinity index via
GetAccountAffinityClientsBatch, returns affinity_client_count and
affinity_clients in DTO. GatewayCache interface extended with the new
batch method backed by a Lua script (get_affinity_clients.lua).

All test mocks synchronized with updated GatewayCache interface.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:52:10 +08:00
erio fbdba40f59 chore: bump version to 0.1.92.11 2026-03-07 03:16:02 +08:00
erioandClaude Opus 4.6 9e107fae73 feat(sora): improve storage management page with split columns, test buttons, quota and video stats
- Split compound "Profile" column into separate Profile ID and Name columns
- Replace "Endpoint" column with "Storage Path" showing bucket/prefix or folder info
- Add GDrive quota display (capacity/used) via new backend API endpoint
- Add video count statistics per storage type via new backend API endpoint
- Add inline test button per profile with 15s timeout and per-profile loading state
- Backend: GetQuotaInfo, CountByStorageType, GetGDriveQuota, GetStorageVideoStats

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:58:27 +08:00
erio 298f5c1baf feat(sora): add GDrive full-cycle test endpoint (upload/download/delete) 2026-03-06 22:33:37 +08:00
erio e0a9c34067 Merge branch 'release/custom-0.1.92' into worktree-feature/sora 2026-03-06 20:47:06 +08:00
erioandClaude Opus 4.6 ad54040c07 feat(sora): add Google Drive storage backend with unified storage abstraction
- Define SoraObjectStorage interface abstracting S3 and GDrive backends
- Implement SoraGDriveStorage with OAuth2 and Service Account auth
- Add SoraStorageRouter to route requests based on active profile provider
- Add GDrive OAuth handler for authorization flow (start + callback)
- Extend profile model with provider, auth_type, and GDrive-specific fields
- Update frontend UI with provider selection, dynamic form fields, and i18n
- Migrate API paths from /sora-s3 to /sora-storage (old paths preserved)
- All existing S3 functionality remains backward compatible

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:45:51 +08:00
erioandClaude Opus 4.6 d7a3c7f8a8 chore: bump version to 0.1.92.10
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:07:02 +08:00
erioandClaude Opus 4.6 9430776393 chore: bump version to 0.1.92.9
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:03:29 +08:00
erioandClaude Opus 4.6 a4ee71d796 chore: bump version to 0.1.92.8
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:51:52 +08:00
erioandClaude Opus 4.6 da99de82e9 chore: bump version to 0.1.92.7
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:55:38 +08:00
erioandClaude Opus 4.6 e8e5acb9e7 revert: remove client affinity count display infrastructure
Remove frontend badge/tooltip and backend counting/query infrastructure
for client affinity. Core client affinity scheduling logic is preserved.

Removed:
- GatewayCache injection in AccountHandler
- GetAccountAffinityCount/Batch/Clients methods and interface
- AffinityClientInfo struct and ClientAffinityTTL function
- /affinity-clients API endpoint and route
- Reverse index (account_affinity:*) Lua scripts
- Frontend blue badge, tooltip, and lazy-load logic
- affinity_client_count field from types and response

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:47:52 +08:00
erioandClaude Opus 4.6 6315dea094 fix: prevent reverse affinity index from premature expiration
The reverse index account_affinity:{accountID} was using the same 1h
EXPIRE as the forward index. But the forward key EXPIRE refreshes on
every client request, while the reverse key only refreshes when a
request is routed to that specific account. This caused reverse keys
to expire prematurely.

Fix: set reverse key EXPIRE to 24h as safety net, rely on
ZREMRANGEBYSCORE for member-level expiration. Also clean up empty
keys after member cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:04:52 +08:00
erio 5f4561306f chore: bump version to 0.1.92.5
Made-with: Cursor
2026-03-06 17:31:27 +08:00
erioandClaude Opus 4.6 af5d5dbcbc chore: bump version to 0.1.92.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 17:01:10 +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 064a70db29 fix: update wire_gen.go to pass gatewayCache to NewAccountHandler 2026-03-06 15:55:23 +08:00
erio c616284890 chore: bump version to 0.1.92.3 2026-03-06 15:49:11 +08:00
erio 69abdff732 chore: bump version to 0.1.92.2 2026-03-06 14:24:58 +08:00
erio 75f1faea14 chore: bump version to 0.1.92.1 2026-03-06 13:08:32 +08:00
erio e74270f8eb chore: bump version to 0.1.91.4 2026-03-06 05:29:07 +08:00
erio ee7d6bc19f fix: address load_factor code review findings
- Fix bulk edit: send 0 instead of null/NaN to clear load_factor
- Fix edit modal: explicit NaN check instead of implicit falsy
- Fix create modal: use ?? instead of || for load_factor
- Add load_factor upper limit validation (max 10000)
- Add //go:build unit tag and self-contained intPtrHelper in test
- Add design intent comments on WaitPlan.MaxConcurrency
2026-03-06 04:27:41 +08:00
erio 3d93a29b35 fix: validate account status before update and update load factor hint
- Normalize non-standard status (e.g. "error") to "active" on edit load
- Add pre-submit validation for status field to prevent 400 errors
- Update load factor hint: "提高负载因子可以提高对账号的调度频率"
2026-03-06 04:16:47 +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
guoyongchangandClaude Opus 4.6 817a491087 simplify: 移除 leader lock,单实例无需分布式锁
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 16:31:27 +08:00
guoyongchangandClaude Opus 4.6 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
guoyongchangandClaude Opus 4.6 8adf80d98b fix: wire_gen_test 补充 scheduledTestRunner 参数
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 16:23:41 +08:00
guoyongchangandClaude Opus 4.6 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