shaw
aa4b102108
fix: 移除Antigravity的apikey账户额外的表单
2026-02-09 22:15:14 +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
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
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
erio
df3346387f
fix(frontend): upstream account edit fields and mixed_scheduling on create
...
- EditAccountModal: add Base URL / API Key fields for upstream type
- EditAccountModal: initialize editBaseUrl from credentials on upstream account open
- EditAccountModal: save upstream credentials (base_url, api_key) on submit
- CreateAccountModal: pass mixed_scheduling extra when creating upstream account
2026-02-08 02:08:51 +08:00
shaw
da9546ba24
fix(ui): widen CreateAccountModal to fix platform selector overflow
2026-02-07 17:25:52 +08:00
erio
2656320d04
fix(antigravity): fetch default mapping from API and sync Redis on rate limit
...
1. Frontend: replace hardcoded antigravityDefaultMappings with async
fetch from GET /admin/accounts/antigravity/default-model-mapping,
eliminating the duplicate data source that caused frontend/backend
mapping inconsistency.
2. Backend: convert handleSmartRetry and antigravityRetryLoop from
standalone functions to AntigravityGatewayService methods, enabling
Redis cache sync (updateAccountModelRateLimitInCache) after both
rate-limit write paths — long-delay branch and retry-exhausted branch.
2026-02-07 15:59:27 +08:00
erio
5e98445b22
feat(antigravity): comprehensive enhancements - model mapping, rate limiting, scheduling & ops
...
Key changes:
- Upgrade model mapping: Opus 4.5 → Opus 4.6-thinking with precise matching
- Unified rate limiting: scope-level → model-level with Redis snapshot sync
- Load-balanced scheduling by call count with smart retry mechanism
- Force cache billing support
- Model identity injection in prompts with leak prevention
- Thinking mode auto-handling (max_tokens/budget_tokens fix)
- Frontend: whitelist mode toggle, model mapping validation, status indicators
- Gemini session fallback with Redis Trie O(L) matching
- Ops: enhanced concurrency monitoring, account availability, retry logic
- Migration scripts: 049-051 for model mapping unification
2026-02-07 12:31:10 +08:00
shaw
01b08e1e43
chore: 前端增加opus4.6模型映射
2026-02-06 08:50:45 +08:00
song
976d6fb03f
chore: update antigravity example url
2026-02-03 17:00:46 +08:00
song
3bede6e65f
merge upstream main
2026-02-03 16:21:58 +08:00
Wesley Liddick
bb3df5785a
Merge pull request #322 from xlx0852/main
...
fix: 混合渠道警告确认框和过滤 prompt_cache_retention 参数
2026-02-03 15:13:10 +08:00
liuxiongfeng
d3c1d77a35
fix(frontend): import missing formatTime function in AccountStatusIndicator
2026-02-03 14:25:30 +08:00
liuxiongfeng
8824400c3e
feat(accounts): 账号列表显示 Antigravity scope 级别限流状态
...
- 后端 DTO 新增 scope_rate_limits 字段,从 extra 提取限流信息
- 前端状态列显示 scope 级限流徽章(Claude/Gemini/Image)
- 清除速率限制时同时清除账号级和 scope 级限流(已有实现)
Cherry-picked from slovx2/sub2api: 66f49b67
2026-02-03 14:25:30 +08:00
song
11ff73b578
fix: align migration checksum and import formatTime
2026-02-03 14:04:11 +08:00
song
3ecadf4aad
chore: apply stashed changes
2026-02-02 22:20:08 +08:00
song
0170d19fa7
merge upstream main
2026-02-02 22:13:50 +08:00
song
66f49b67d6
feat(accounts): 账号列表显示 Antigravity scope 级别限流状态
...
- 后端 DTO 新增 scope_rate_limits 字段,从 extra 提取限流信息
- 前端状态列显示 scope 级限流徽章(Claude/Gemini/Image)
- 清除速率限制时同时清除账号级和 scope 级限流(已有实现)
2026-01-27 11:04:41 +08:00
shaw
fd73b8875d
feat(frontend): 优化账号限流状态显示,直接展示倒计时
2026-01-23 15:48:25 +08:00
song
52c745bc62
feat: 为 Antigravity 平台启用拦截预热请求功能
2026-01-21 20:40:45 +08:00
墨颜
4f4c9679bf
fix(groups): 用户分组不下发内部路由信息
...
- 普通用户 Group DTO 移除 model_routing/account_count/account_groups,避免泄露内部路由与账号信息\n- 新增 AdminGroup DTO,并仅在管理员分组接口返回完整字段\n- 前端拆分 Group/AdminGroup,管理端页面与 API 使用 AdminGroup\n- 增加 /api/v1/groups/available 契约测试,防止回归
2026-01-19 18:58:42 +08:00
shaw
ccfeaeb22d
feat: 新增会话ID伪装功能,优化日志系统
...
- 新增 session_id_masking_enabled 配置,启用后将在15分钟内固定
metadata.user_id 中的 session ID
- TLS fingerprint 模块日志从自定义 debugLog 迁移到 slog
- main.go 添加 slog 初始化,根据 gin mode 设置日志级别
- 前端创建/编辑账号模态框添加会话ID伪装开关
- 多语言支持(中英文)
2026-01-19 10:22:13 +08:00
shaw
2028cc29b7
fix: 修复多个管理后台问题
...
- 分页接口 page_size 最大限制从 100 改为 1000
- 通过 Redis Pub/Sub 实现跨实例认证缓存失效
- 允许订阅类型分组编辑计费倍率
- 账号计费倍率支持 3 位小数
2026-01-18 22:13:47 +08:00
shaw
9abda1bc59
feat(tls): 新增 TLS 指纹模拟功能
2026-01-18 20:08:40 +08:00
shaw
a07174c191
fix: 修复会话限制功能并在创建账号时支持配额控制
2026-01-18 16:41:15 +08:00
Wesley Liddick
0c2a901af4
Merge pull request #317 from IanShaw027/fix/gemini-issue
...
fix(gemini,group): 更新 Gemini 模型配置并补齐 SIMPLE 默认分组
2026-01-18 14:30:42 +08:00
nick8802754751
6549a40cf4
refactor: 使用 ConfirmDialog 组件替代原生 confirm() 对话框
...
- EditAccountModal 和 CreateAccountModal 使用 ConfirmDialog 组件
- 保存 pending payload 供确认后重试
- 添加 mixedChannelWarningTitle 翻译
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-01-17 16:16:47 +08:00
nick8802754751
4e75d8fda9
fix: 添加混合渠道警告确认框和过滤 prompt_cache_retention 参数
...
- 前端: EditAccountModal 和 CreateAccountModal 添加 409 mixed_channel_warning 处理
- 前端: 弹出确认框让用户确认混合渠道风险
- 后端: 过滤 OpenAI 请求中的 prompt_cache_retention 参数(上游不支持)
- 添加中英文翻译
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-01-17 16:06:44 +08:00
IanShaw027
28e46e0e7c
fix(gemini): 更新 Gemini 模型列表配置
...
- 移除已弃用的 1.5 系列模型
- 调整模型优先级顺序(2.0 Flash > 2.5 Flash > 2.5 Pro > 3.0 Preview)
- 同步前后端模型配置
- 更新相关测试用例和默认模型选择逻辑
2026-01-16 23:47:42 +08:00
shaw
7379423325
feat: 添加5h窗口费用控制和会话数量限制
...
- 支持Anthropic OAuth/SetupToken账号的5h窗口费用阈值控制
- 支持账号级别的并发会话数量限制
- 使用Redis缓存窗口费用(30秒TTL)减少数据库压力
- 费用计算基于标准费用(不含账号倍率)
2026-01-16 23:36:52 +08:00
墨颜
fb99ceacc7
feat(计费): 支持账号计费倍率快照与统计展示
...
- 新增 accounts.rate_multiplier(默认 1.0,允许 0)
- 使用 usage_logs.account_rate_multiplier 记录倍率快照,避免历史回算
- 统计/导出/管理端展示账号口径费用(total_cost * account_rate_multiplier)
2026-01-14 16:12:08 +08:00
shaw
68ba866c38
fix(frontend): 修复账号管理页面分组显示和 Cookie 授权问题
...
- 新增 AccountGroupsCell 组件优化分组列显示(最多4个+折叠)
- 修复 Cookie 自动授权时 group_ids/notes/expires_at 字段丢失
- 修复 SettingsView 流超时配置前后端字段不一致问题
2026-01-12 16:08:44 +08:00
ianshaw
6dcb27632e
fix(gateway): 自定义错误码触发停止调度
...
- 修改 HandleUpstreamError 逻辑,启用自定义错误码时所有在列表中的错误码都会停止调度
- 添加 handleCustomErrorCode 函数处理自定义错误码的账号停用
- 前端添加 429/529 错误码的警告提示,因为这些错误码已有内置处理机制
- 更新 EditAccountModal、CreateAccountModal、BulkEditAccountModal 的错误码添加逻辑
2026-01-11 22:20:02 -08:00
IanShaw
afcfbb458d
fix(gemini): Google One 强制使用内置 OAuth client + 自动获取 project_id + UI 优化 ( #212 )
...
* fix(gemini): Google One 强制使用内置 OAuth client + 自动获取 project_id + UI 优化
## 后端改动
### 1. Google One 强制使用内置 Gemini CLI OAuth Client
**问题**:
- Google One 之前允许使用自定义 OAuth client,导致认证流程不稳定
- 与 Code Assist 的行为不一致
**解决方案**:
- 修改 `gemini_oauth_service.go`: Google One 现在与 Code Assist 一样强制使用内置 client (L122-135)
- 更新 `gemini_oauth_client.go`: ExchangeCode 和 RefreshToken 方法支持强制内置 client (L31-44, L77-86)
- 简化 `geminicli/oauth.go`: Google One scope 选择逻辑 (L187-190)
- 标记 `geminicli/constants.go`: DefaultGoogleOneScopes 为 DEPRECATED (L30-33)
- 更新测试用例以反映新行为
**OAuth 类型对比**:
| OAuth类型 | Client来源 | Scopes | Redirect URI |
|-----------|-----------|--------|-----------------|
| code_assist | 内置 Gemini CLI | DefaultCodeAssistScopes | https://codeassist.google.com/authcode |
| google_one | 内置 Gemini CLI (新) | DefaultCodeAssistScopes | https://codeassist.google.com/authcode |
| ai_studio | 必须自定义 | DefaultAIStudioScopes | http://localhost:1455/auth/callback |
### 2. Google One 自动获取 project_id
**问题**:
- Google One 个人账号测试模型时返回 403/404 错误
- 原因:cloudaicompanion API 需要 project_id,但个人账号无需手动创建 GCP 项目
**解决方案**:
- 修改 `gemini_oauth_service.go`: OAuth 流程中自动调用 fetchProjectID
- Google 通过 LoadCodeAssist API 自动分配 project_id
- 与 Gemini CLI 行为保持一致
- 后端根据 project_id 自动选择正确的 API 端点
**影响**:
- Google One 账号现在可以正常使用(需要重新授权)
- Code Assist 和 AI Studio 账号不受影响
### 3. 修复 Gemini 测试账号无内容输出问题
**问题**:
- 测试 Gemini 账号时只显示"测试成功",没有显示 AI 响应内容
- 原因:processGeminiStream 在检查到 finishReason 时立即返回,跳过了内容提取
**解决方案**:
- 修改 `account_test_service.go`: 调整逻辑顺序,先提取内容再检查是否完成
- 确保最后一个 chunk 的内容也能被正确显示
**影响**:
- 所有 Gemini 账号类型(API Key、OAuth)的测试现在都会显示完整响应内容
- 用户可以看到流式输出效果
## 前端改动
### 1. 修复图标宽度压缩问题
**问题**:
- 账户类型选择按钮中的图标在某些情况下会被压缩变形
**解决方案**:
- 修改 `CreateAccountModal.vue`: 为所有平台图标容器添加 `shrink-0` 类
- 确保 Anthropic、OpenAI、Gemini、Antigravity 图标保持固定 8×8 尺寸 (32px × 32px)
### 2. 优化重新授权界面
**问题**:
- 重新授权时显示三个可点击的授权类型选择按钮,可能导致用户误切换到不兼容的授权方式
**解决方案**:
- 修改 `ReAuthAccountModal.vue` (admin 和普通用户版本):
- 将可点击的授权类型选择按钮改为只读信息展示框
- 根据账号的 `credentials.oauth_type` 动态显示对应图标和文本
- 删除 `geminiAIStudioOAuthEnabled` 状态和 `handleSelectGeminiOAuthType` 方法
- 防止用户误操作
## 测试验证
- ✅ 所有后端单元测试通过
- ✅ OAuth client 选择逻辑正确
- ✅ Google One 和 Code Assist 行为一致
- ✅ 测试账号显示完整响应内容
- ✅ UI 图标显示正常
- ✅ 重新授权界面只读展示正确
* fix(lint): 修复 golangci-lint 错误信息格式问题
- 将错误信息改为小写开头以符合 Go 代码规范
- 修复 ST1005: error strings should not be capitalized
2026-01-08 23:47:29 +08:00
LLLLLLiulei
2b528c5f81
feat: auto-pause expired accounts
2026-01-07 16:59:35 +08:00
yangjianbo
1181b332f7
fix(前端): 修复编辑账号错误提示无法显示具体原因的问题
...
后端 API 返回 message 字段,但前端读取 detail 字段,导致无法显示具体错误信息。
现在优先读取 message 字段,兼容 detail 字段。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-06 15:46:36 +08:00
shaw
af753de481
fix: 修复账号修改代理更新无效的bug
2026-01-06 09:04:01 +08:00
shaw
706af2920f
Merge branch 'fix/account-filters-menu-missing-features'
...
## Summary
- 修复账号管理页面组件拆分时遗漏的功能
- 统一所有内联 SVG 为 Icon 组件
- 修复 ProxySelector 选择"无代理"时发送错误值的问题
## Changes
- AccountTableFilters: 添加 Antigravity 平台选项、类型筛选器、inactive 状态
- AccountActionMenu: 恢复重置状态和清除限速按钮
- AccountsView: 修正 handleClearRateLimit 调用正确的 API
- ProxySelector: 修复选择"无代理"时发送 null 而不是 0
## Conflict Resolution
- ProxySelector.vue: 采用 PR 分支的正确逻辑(发送 null 而不是 0)
这是正确的修复,因为后端使用 *int64 类型,nil 会触发 ClearProxyID()
2026-01-05 21:16:05 +08:00
IanShaw027
4251a5a451
refactor(frontend): 完成所有组件的内联SVG统一替换为Icon组件
...
- 扩展 Icon.vue 组件,新增 60+ 图标路径
- 导航类: arrowRight, arrowLeft, arrowUp, arrowDown, chevronUp, externalLink
- 状态类: checkCircle, xCircle, exclamationCircle, exclamationTriangle, infoCircle
- 用户类: user, userCircle, userPlus, users
- 文档类: document, clipboard, copy, inbox
- 操作类: download, upload, filter, sort
- 安全类: key, lock, shield
- UI类: menu, calendar, home, terminal, gift, creditCard, mail
- 数据类: chartBar, trendingUp, database, cube
- 其他: bolt, sparkles, cloud, server, sun, moon, book 等
- 重构 56 个 Vue 组件,用 Icon 组件替换内联 SVG
- 净减少约 2200 行代码
- 提升代码可维护性和一致性
- 统一图标样式和尺寸管理
2026-01-05 20:22:48 +08:00
LLLLLLiulei
94750fb61f
feat: add account notes field
2026-01-05 14:07:33 +08:00
ianshaw
118ca5cf6d
fix: 修复空content处理及更新Gemini使用指南链接
...
- 修复FilterThinkingBlocksForRetry对空content数组的处理
- docker-compose添加SECURITY_URL_ALLOWLIST_UPSTREAM_HOSTS配置
- 更新Gemini使用指南链接:检查归属地、修改归属地、激活Gemini Web
2026-01-04 18:26:39 -08:00
IanShaw027
aa6f253374
merge: 合并 upstream/main 并解决冲突
...
解决了以下文件的冲突:
- backend/internal/handler/admin/setting_handler.go
- 采用 upstream 的字段对齐风格和 *Configured 字段名
- 添加 EnableIdentityPatch 和 IdentityPatchPrompt 字段
- backend/internal/handler/gateway_handler.go
- 采用 upstream 的 billingErrorDetails 错误处理方式
- frontend/src/api/admin/settings.ts
- 采用 upstream 的 *_configured 字段名
- 添加 enable_identity_patch 和 identity_patch_prompt 字段
- frontend/src/views/admin/SettingsView.vue
- 合并 turnstile_secret_key_configured 字段
- 保留 enable_identity_patch 和 identity_patch_prompt 字段
2026-01-04 23:17:15 +08:00
yangjianbo
7dddd06583
Merge branch 'main' of https://github.com/mt21625457/aicodex2api
2026-01-04 21:06:12 +08:00
IanShaw027
c86d445cb7
fix(frontend): sync with main and finalize i18n & component optimizations
2026-01-04 21:00:10 +08:00
IanShaw027
6c036d7b59
fix(frontend): 优化前端组件和国际化支持
...
- 添加 Accept-Language 请求头支持后端翻译
- 优化账户状态指示器和测试模态框
- 简化用户属性表单和配置模态框
- 新增多个国际化翻译条目
- 重构管理视图代码,提升可维护性
2026-01-04 20:49:34 +08:00
IanShaw027
2632a7102d
refactor(settings): 规范化缩写词命名并优化前端帮助界面
...
- 后端:将 Smtp/Api/Doc 字段改为 SMTP/API/Doc(遵循 Go 命名规范)
- 前端:添加 Gemini 帮助按钮,简化配额说明展示
2026-01-04 17:02:38 +08:00
IanShaw027
a185ad1144
feat(gemini): 完善 Gemini OAuth 配额系统和用量显示
...
主要改动:
- 后端:重构 Gemini 配额服务,支持多层级配额策略(GCP Standard/Free, Google One, AI Studio, Code Assist)
- 后端:优化 OAuth 服务,增强 tier_id 识别和存储逻辑
- 后端:改进用量统计服务,支持不同平台的配额查询
- 后端:优化限流服务,增加临时解除调度状态管理
- 前端:统一四种授权方式的用量显示格式和徽标样式
- 前端:增强账户配额信息展示,支持多种配额类型
- 前端:改进创建和重新授权模态框的用户体验
- 国际化:完善中英文配额相关文案
- 移除 CHANGELOG.md 文件
测试:所有单元测试通过
2026-01-04 15:36:00 +08:00
IanShaw027
7fe09c8342
fix(frontend): 统一徽标样式并修复 Google One 用量显示
...
**修复内容:**
1. **统一徽标样式**
- 所有徽标使用相同的 Tailwind 类
- Free: gray-100/600, Pro: blue-100/600, Ultra: purple-100/600
- 暗色模式统一使用 /40 透明度
- Client 和 AI Studio 都使用蓝色徽标
2. **修复 Google One 用量显示**
- 后端已为所有 Gemini OAuth (GCP/Google One/Client) 返回用量数据
- 前端只要有用量数据就显示进度条(移除 isGeminiCodeAssist 限制)
- Google One 现在也会显示 Pro/Flash 进度条 + 统计数据
- 只有自定义 Client OAuth 显示「无限流」(无追踪)
**最终显示规则:**
- AI Studio API Key: 「无限流」或「限流 XX」
- Client OAuth: 「无限流」(无追踪)
- GCP OAuth: Pro/Flash 进度条 + 统计
- Google One OAuth: Pro/Flash 进度条 + 统计
2026-01-04 10:42:37 +08:00