Commit Graph

503 Commits

Author SHA1 Message Date
liuxiongfeng
59e8465325 Merge release/custom-0.1.81 into release/custom-0.1.83
- Resolved conflict in .github/workflows/security-scan.yml: use upstream .gosec.json config
- Resolved conflict in deploy/docker-compose.yml: keep Redis, remove PostgreSQL (use external DB)
2026-02-14 22:03:09 +08:00
liuxiongfeng
be6e8ff77b fix(ui): extend mixed channel check to both Antigravity and Anthropic accounts
Problem:
- When creating Anthropic Console accounts to groups with Antigravity accounts,
  the mixed channel warning was not triggered
- Only Antigravity accounts triggered the confirmation dialog

Solution:
- Renamed isAntigravityAccount to needsMixedChannelCheck
- Extended check to include both 'antigravity' and 'anthropic' platforms
- Updated all 8 call sites in CreateAccountModal and EditAccountModal

Changes:
- frontend/src/components/account/CreateAccountModal.vue: 4 updates
- frontend/src/components/account/EditAccountModal.vue: 4 updates

Testing:
- Frontend compilation: passed
- Backend unit tests: passed
- OAuth flow: confirmation parameter correctly passed in Step 2
- Backend compatibility: verified with checkMixedChannelRisk logic

Impact:
- Both Antigravity and Anthropic accounts now show mixed channel warning
- OAuth accounts correctly pass confirm_mixed_channel_risk parameter
- No breaking changes to existing functionality
2026-02-14 21:29:36 +08:00
shaw
a817cafe3d feat: 区分 Anthropic 5m/1h 缓存创建 token 的差异化计费
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 标识
2026-02-14 18:15:35 +08:00
Wesley Liddick
471943269c Merge pull request #573 from wucm667/fix/stat-card-value-overflow
修复:StatCard 数值溢出问题
2026-02-13 20:29:12 +08:00
Wesley Liddick
28a5e2f0e6 Merge pull request #570 from wucm667/fix/sidebar-logo-load-flicker
fix: 修复侧边栏 Logo 加载时的闪烁问题
2026-02-13 20:29:01 +08:00
wucm667
be56a282f2 修复:StatCard 数值溢出问题
- 添加 title 属性,鼠标悬停时显示完整数值
- 添加 truncate 类防止数值溢出
- 优化长数值的显示效果
2026-02-13 15:59:30 +08:00
wucm667
d1cd5c0a73 Update frontend/src/components/layout/AppSidebar.vue
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-13 10:29:26 +08:00
wucm667
5429c74c10 fix: 修复侧边栏 Logo 加载时的闪烁问题
- 添加 settingsLoaded 条件判断,确保公共设置加载完成后再显示 Logo
- 避免在设置未加载时显示默认 Logo 造成的闪烁效果
2026-02-13 10:21:17 +08:00
liuxiongfeng
8cb7356bbc feat: add mixed-channel precheck flow for antigravity accounts 2026-02-13 03:12:09 +08:00
liuxiongfeng
739c80227a fix(ui): reset mixed channel warning on close 2026-02-13 00:23:15 +08:00
liuxiongfeng
6218eefd61 refactor(ui): extract mixed channel warning handler 2026-02-13 00:22:14 +08:00
liuxiongfeng
ae770a625b fix(ui): mixed channel confirm for upstream create 2026-02-12 23:49:41 +08:00
liuxiongfeng
5e518f5fbd feat: allow antigravity warmup intercept toggle
- Show warmup-intercept toggle for antigravity accounts in admin UI\n- Add unit tests verifying antigravity accounts are intercepted on /v1/messages
2026-02-12 18:56:55 +08:00
kyx236
fe1d46a8ea feat(admin): Add group filtering for account listings
- 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
2026-02-12 03:47:06 +08:00
liuxiongfeng
7f03319646 Revert "fix: 并发/排队面板支持 platform/group 过滤"
This reverts commit 86e600aa52.
2026-02-11 23:06:59 +08:00
liuxiongfeng
a747c63b8e feat: add gemini model mapping whitelist for apikey and bulk edit 2026-02-11 22:31:27 +08:00
liuxiongfeng
c75ae56f10 Merge branch 'develop' into release/custom-0.1.81 2026-02-11 20:49:18 +08:00
Wesley Liddick
c7b42148a5 Merge pull request #559 from wucm667/fix/auth-page-logo
fix: 修复登录/注册页面自定义 Logo 不显示及闪烁问题
2026-02-11 20:01:03 +08:00
Wesley Liddick
bc1abb6a23 Merge pull request #557 from james-6-23/main
feat(admin): 为账户和兑换码新增邮箱搜索及限流过滤功能
2026-02-11 20:00:43 +08:00
liuxiongfeng
caaed775aa ui: 模型限流标签每行最多显示3个,超出自动换行 2026-02-11 18:51:51 +08:00
wucm667
ef2c35dbb1 🐛 fix: 修复登录/注册页面自定义 Logo 不显示及闪烁问题
- sanitizeUrl 新增 allowDataUrl 选项,支持 data:image/ 格式的 base64 图片 URL
- AuthLayout 改用 appStore 缓存数据,避免重复 API 请求和默认 Logo 闪烁

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:04:57 +08:00
kyx236
04a1a7c2b5 feat(admin): Add email search and rate limit filtering for accounts and redeem codes
- 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
2026-02-11 16:39:42 +08:00
liuxiongfeng
86e600aa52 fix: 并发/排队面板支持 platform/group 过滤
- 添加 platformFilter/groupIdFilter props 变化监听器,过滤条件变化时
  立即重新加载数据(修复选择平台后显示"暂无数据"的问题)
- 全栈为 getUserConcurrencyStats 添加 platform/group_id 过滤支持:
  前端 API → Handler 解析 query params → Service 层过滤逻辑
- Service 层通过账号的 group 关联反查用户的 AllowedGroups,
  与 GetConcurrencyStats 的过滤模式保持一致
2026-02-11 01:41:34 +08:00
Tian
c8f87a9c92 feat(antigravity): 支持 Refresh Token 批量导入创建 OAuth 账号
后端新增 ValidateRefreshToken service 方法和 POST /oauth/refresh-token 端点,
前端新增 API/Composable/UI 集成,OAuthAuthorizationFlow i18n 动态化,
支持在 Antigravity 创建账号时批量粘贴 Refresh Token 自动验证并创建账号。
2026-02-11 01:23:21 +08:00
liuxiongfeng
f176150c93 Merge branch 'release/custom-0.1.79'
# Conflicts:
#	AGENTS.md
#	CLAUDE.md
#	backend/cmd/server/VERSION
#	backend/internal/handler/gateway_handler.go
#	backend/internal/handler/gemini_v1beta_handler.go
#	backend/internal/service/antigravity_gateway_service.go
#	backend/internal/service/antigravity_rate_limit_test.go
#	backend/internal/service/antigravity_single_account_retry_test.go
#	backend/internal/service/antigravity_smart_retry_test.go
2026-02-11 00:32:11 +08:00
liuxiongfeng
c4d6715443 chore: squash merge customizations from develop-old-0.1.77
- 定制文档: CLAUDE.md, AGENTS.md
- UI定制: 微信客服按钮, 首页改造, 移除GitHub链接
- 部署运维: docker-compose.yml, 压测脚本
- CI/gitignore 小改动
2026-02-10 20:59:54 +08:00
Edric Li
7d0a30fa8f merge: sync upstream main (antigravity single-account 503 retry)
合并上游新增的 Antigravity 单账号 503 退避重试机制,
解决与本地 MODEL_CAPACITY_EXHAUSTED 逻辑的冲突,两者共存。
2026-02-10 12:00:21 +08:00
Edric Li
d95e04fd1f feat: 错误透传规则支持 skip_monitoring 跳过运维监控记录
在每条错误透传规则上新增 skip_monitoring 选项,开启后匹配该规则的错误
不会被记录到 ops_error_logs,减少监控噪音。默认关闭,不影响现有规则。
2026-02-10 11:42:39 +08:00
erio
9cf4882f4c Merge tag 'v0.1.78' into develop
Resolve conflict in antigravity_gateway_service.go by keeping both
retry strategies:
- MODEL_CAPACITY_EXHAUSTED: handleModelCapacityExhaustedRetry (ours)
- Single-account 503 long delay: handleSingleAccountRetryInPlace (upstream)

Update tests to reflect that MODEL_CAPACITY_EXHAUSTED always goes
through capacity retry regardless of single-account mode.
2026-02-10 11:32:56 +08:00
shaw
5dd83d3cf2 fix: 移除特定system以适配新版cc客户端缓存失效的bug 2026-02-10 10:28:34 +08:00
erio
100a70f87c Merge remote-tracking branch 'upstream/main' into develop 2026-02-09 22:27:07 +08:00
shaw
aa4b102108 fix: 移除Antigravity的apikey账户额外的表单 2026-02-09 22:15:14 +08:00
erio
4a84ca9a02 fix: support clearing model-level rate limits from action menu and temp-unsched reset 2026-02-09 20:37:30 +08:00
erio
228aca9523 Merge branch 'fix/gemini-error-policy-before-retry' into develop
# Conflicts:
#	backend/cmd/server/VERSION
2026-02-09 20:08:31 +08:00
erio
7e4637cd70 fix: support clearing model-level rate limits from action menu and temp-unsched reset 2026-02-09 20:08:00 +08:00
erio
e666356483 fix: resolve merge conflict in OpsConcurrencyCard.vue 2026-02-09 18:12:39 +08:00
erio
470b37be7e fix: pass platform prop to GroupBadge in GroupSelector
GroupBadge in GroupSelector was missing the platform prop, causing all
group badges in account edit/detail pages to use fallback colors instead
of platform-specific colors (e.g. Claude=orange, Gemini=blue).
2026-02-09 14:33:05 +08:00
erio
da2fbd9924 Merge tag 'v0.1.76' into develop
重构速率限制从 scope 级别到 model 级别,新增分组拖拽排序功能,优化 Antigravity 智能重试和错误处理策略。

- 分组拖拽排序:管理后台支持拖拽调整分组顺序
- 账号调度防雷群:相同优先级的账号在调度时随机打乱,防止并发请求集中到同一账号
- 上游账号路由:AccountTypeUpstream 正确路由到 ForwardUpstream 流程
- 客户端断开检测:流式响应时检测客户端断开,继续消费上游响应以确保计费准确
- Antigravity 失败切换延迟:账号切换时增加线性延迟,避免瞬时切换造成雪崩
- Gemini 错误策略集成:统一 Antigravity 错误策略,支持 Gemini 账号自定义错误码

- 重构速率限制:从 scope 级别(claude/gemini_text/gemini_image)改为 model 级别限速,简化账号选择算法
- 重构会话存储:使用扁平缓存替代 Trie 结构,简化 digest session 存储
- 速率限制延迟:使用上游返回的 retryDelay 而非固定 30s 默认值

- 修复 Gemini 原生请求格式解析,确保 session hash 正确生成
- 修复不同用户发送相同消息时 sessionHash 冲突问题
- 修复 thoughtSignature 清理逻辑,现在适用于所有客户端而非仅 CLI
- 修复粘性会话失败切换时的缓存计费豁免问题

# Conflicts:
#	backend/cmd/server/VERSION
#	backend/internal/service/gateway_multiplatform_test.go
#	backend/internal/service/gemini_multiplatform_test.go
#	frontend/src/components/account/AccountStatusIndicator.vue
#	frontend/src/views/admin/ops/components/OpsConcurrencyCard.vue
2026-02-09 12:40:26 +08:00
erio
084e0adb34 feat: squash merge all changes from develop-0.1.75
Squash of 124 commits from the legacy develop branch (develop-0.1.75)
onto a clean v0.1.75 upstream base, to simplify future upstream merges.

Key changes included:
- Refactor scope-level rate limiting to model-level rate limiting
- Antigravity gateway service improvements (smart retry, error policy)
- Digest session store (flat cache replacing Trie-based store)
- Client disconnect detection during streaming
- Gemini messages compatibility service enhancements
- Scheduler shuffle for thundering herd prevention
- Session hash generation improvements
- Frontend customizations (WeChat service, HomeView, etc.)
- Ops monitoring scope cleanup
2026-02-09 12:32:35 +08:00
QTom
5e0d789440 feat(admin): 新增 CRS 同步预览和账号选择功能
- 后端新增 PreviewFromCRS 接口,允许用户先预览 CRS 中的账号
- 后端支持在同步时选择特定账号,不选中的账号将被跳过
- 前端重构 SyncFromCrsModal 为三步向导:输入凭据 → 预览账号 → 执行同步
- 改进表单无障碍性:添加 for/id 关联和 required 属性
- 修复 Back 按钮返回时的状态清理
- 新增 buildSelectedSet 和 shouldCreateAccount 的单元测试
- 完整的向后兼容性:旧客户端不发送 selected_account_ids 时行为不变
2026-02-09 10:39:09 +08:00
erio
fc095bf054 refactor: replace scope-level rate limiting with model-level rate limiting
Merge functional changes from develop branch:
- Remove AntigravityQuotaScope system (claude/gemini_text/gemini_image)
- Replace with per-model rate limiting using resolveAntigravityModelKey
- Remove model load statistics (IncrModelCallCount/GetModelLoadBatch)
- Simplify account selection to unified priority→load→LRU algorithm
- Remove SetAntigravityQuotaScopeLimit from AccountRepository
- Clean up scope-related UI indicators and API fields
2026-02-09 08:19:01 +08:00
erio
2f1182e8a9 feat: unified error policy for Antigravity + enable custom error codes for Gemini accounts 2026-02-09 06:54:42 +08:00
Wesley Liddick
5fa93ebdc7 Merge pull request #519 from bayma888/feature/group-sort-order
feat(admin): 新增-分组管理自由拖拽排序功能
2026-02-08 18:00:22 +08:00
bayma888
2eb32a0ed7 chore: update pnpm-lock.yaml for vue-draggable-plus
CI 的 pnpm install --frozen-lockfile 需要 lock 文件同步更新
2026-02-08 17:10:25 +08:00
bayma888
bac9e2bfd5 feat(admin): add drag-and-drop group sort order
- Add `sort_order` field to groups table with migration
- Add `PUT /api/v1/admin/groups/sort-order` API for batch update
- Implement drag-and-drop UI using vue-draggable-plus
- All queries now order groups by sort_order
- Add i18n support (en/zh) for sort-related UI text
- Update test stubs to satisfy new interface methods
2026-02-08 16:53:45 +08:00
shaw
e4d74ae11d feat(ui): 用户列表页显示当前并发数
优化 /admin/users 页面的并发数列,显示「当前/最大」格式,
参考 AccountCapacityCell 的设计风格。

- 后端 UserHandler 注入 ConcurrencyService,批量查询用户当前并发数
- 新增 UserConcurrencyCell 组件,支持颜色状态(空闲灰/使用中黄/满载红)
- 前端 AdminUser 类型添加 current_concurrency 字段
2026-02-08 16:44:51 +08:00
shaw
8a0a8558cf feat(ui): OpenAI OAuth 账号支持批量 RT 输入创建
新增通过手动输入 Refresh Token 创建 OpenAI OAuth 账号功能,
参考 Anthropic sessionKey 批量创建方式:

- useOpenAIOAuth 添加 validateRefreshToken 方法
- accounts.ts 添加 refreshOpenAIToken API
- AuthInputMethod 类型新增 refresh_token 选项
- 支持多行输入 RT(每行一个)批量创建账号
- 账号名称自动累加后缀 #1, #2 等
- UI 显示 RT 数量徽章和批量创建提示
- 添加中英文 i18n 翻译
2026-02-08 16:10:15 +08:00
Wesley Liddick
2185a3b674 Merge pull request #517 from touwaeriol/fix/upstream-baseurl
refactor(upstream): replace upstream account type with apikey + auto-append base_url
2026-02-08 14:03:12 +08:00
shaw
b1c30df8e3 fix(ui): unify admin table toolbar layout with search and buttons in single row
Standardize filter bar layout across admin pages to place search/filters
on left and action buttons on right within the same row, improving
visual consistency and space utilization.
2026-02-08 14:00:02 +08:00
erio
fb58560d15 refactor(upstream): replace upstream account type with apikey, auto-append /antigravity
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
2026-02-08 13:06:25 +08:00