github-actions[bot]
c70070d912
chore: sync VERSION file with release v1.1.227 [skip ci]
2025-12-05 20:54:53 +00:00
lusipad
849d8e047b
docs: translate isProAccount function comments to English
...
- Change function description from Chinese to English
- Translate inline comments (API priority, local config)
- Keep function logic unchanged
This completes the full English comment translation for all modified files.
2025-12-06 04:54:41 +08:00
github-actions[bot]
065aa6d35e
chore: sync VERSION file with release v1.1.226 [skip ci]
2025-12-05 20:45:07 +00:00
lusipad
10a1d61427
docs: translate remaining Chinese comments in claudeAccountService.js
...
- Filter Opus models based on account type and model version
- Free account: does not support any Opus model
- Pro account: only supports Opus 4.5+
- Max account: supports all Opus versions
- Account without subscription info defaults to supported
All logic unchanged, only comment translation.
2025-12-06 04:44:52 +08:00
github-actions[bot]
cfdcc97cc7
chore: sync VERSION file with release v1.1.225 [skip ci]
2025-12-05 20:43:32 +00:00
lusipad
ea053c6a16
docs: convert Chinese comments to English
...
- Change VERSION判断逻辑 to VERSION LOGIC
- Change ACCOUNT TYPE判断逻辑 to ACCOUNT TYPE LOGIC
- Translate remaining Chinese phrases to English
- Keep all logic unchanged, only translation
2025-12-06 04:43:11 +08:00
github-actions[bot]
84a8fdeaba
chore: sync VERSION file with release v1.1.224 [skip ci]
2025-12-05 20:26:31 +00:00
lusipad
c1c941aa4c
fix(opus): fix PR#762 review issues and add maintenance comments
...
- Fix regex to support 2-digit minor versions (e.g., opus-4-10)
- Prevent matching 8-digit dates as minor version numbers
- Unify English comments for consistency across codebase
- Extract isProAccount() helper to eliminate code duplication
- Add detailed version logic comments for future maintenance
Changes:
- VERSION LOGIC: Opus 4.5+ returns true (Pro eligible), <4.5 returns false (Max only)
- ACCOUNT RESTRICTIONS: Free=no Opus, Pro=Opus 4.5+, Max=all Opus versions
- REGEX FIX: (\d{1,2}) limits minor version to 1-2 digits, avoiding date confusion
Test: All 21 tests pass
Format: Prettier validated
2025-12-06 04:26:11 +08:00
github-actions[bot]
530d38e4a4
chore: sync VERSION file with release v1.1.223 [skip ci]
2025-12-05 14:16:07 +00:00
lusipad
0bf7bfae04
Merge branch 'Wei-Shaw:main' into main
2025-12-05 22:15:54 +08:00
github-actions[bot]
94aca4dc22
chore: sync VERSION file with release v1.1.222 [skip ci]
v1.1.222
2025-12-05 01:06:39 +00:00
shaw
6bfef2525a
Merge PR #753 : feat: 新增 API Key
...
请求时间线接口与管理端详情页面
2025-12-05 09:03:53 +08:00
github-actions[bot]
5a636a36f6
chore: sync VERSION file with release v1.1.221 [skip ci]
v1.1.221
2025-12-05 00:38:43 +00:00
shaw
b61e1062bf
fix: 修复create_proxyagent调用方式
2025-12-05 08:37:43 +08:00
lusipad
6ab91c0c75
chore: revert version
2025-12-05 08:25:42 +08:00
github-actions[bot]
675e7b9111
chore: sync VERSION file with release v1.1.221 [skip ci]
2025-12-05 00:15:42 +00:00
lusipad
f82db11e7d
Merge pull request #1 from lusipad/feature/opus-45-pro-support
...
feat(account): 支持 Pro 账号使用 Opus 4.5+ 模型
2025-12-05 08:15:32 +08:00
lusipad
06b18b7186
refactor: extract isProAccount helper for Pro account detection
...
Extract duplicate Pro account detection logic into a reusable helper
function that handles both API-returned (hasClaudePro) and locally
configured (accountType) data sources.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-12-05 08:12:51 +08:00
lusipad
12cb841a64
refactor: address Copilot review feedback
...
- Import isOpus45OrNewer from modelHelper instead of duplicating code
- Remove invalid 'claude_free' check (only 'free' is used in practice)
2025-12-05 07:56:53 +08:00
lusipad
dc868522cf
fix: apply ESLint curly rule and remove useless escape chars
2025-12-05 07:49:55 +08:00
lusipad
b1dc27b5d7
style: format test-official-models.js with Prettier
2025-12-05 07:43:15 +08:00
lusipad
b94bd2b822
feat(account): 支持 Pro 账号使用 Opus 4.5+ 模型
...
Opus 4.5 已对 Claude Pro 用户开放,调整账户模型限制逻辑:
- Pro 账号:支持 Opus 4.5+,不支持历史版本 (3.x/4.0/4.1)
- Free 账号:不支持任何 Opus 模型
- Max 账号:支持所有 Opus 版本
修改内容:
- 新增 isOpus45OrNewer() 函数用于精确识别模型版本
- 更新 claudeAccountService.js 中的账户选择逻辑
- 更新 unifiedClaudeScheduler.js 中的模型支持检查
- 新增测试脚本验证官方模型名称识别
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-12-05 07:38:55 +08:00
github-actions[bot]
1b18a1226d
chore: sync VERSION file with release v1.1.220 [skip ci]
v1.1.220
2025-12-04 13:01:54 +00:00
Wesley Liddick
0b2372abab
Merge pull request #756 from SunSeekerX/feature_api_disable_switch
...
feat(account): 新增账户自动防护禁用开关
2025-12-04 08:01:35 -05:00
SunSeekerX
8aca1f9dd1
feat(account): 新增账户自动防护禁用开关
...
支持 disableAutoProtection 配置项,启用后上游 401/400/429/529 错误不再自动禁用账户
2025-12-04 20:47:12 +08:00
atoz03
95ef04c1a3
fix: 保持仪表盘趋势图非负并纠正小时区间
...
- 小时粒度请求使用用户选择的起止时间,避免近24小时被截成整天
- 修正日期展示格式化逻辑,减少时区偏移导致的窗口错位
- 趋势图 Y 轴(Token/请求数/费用等)强制最小值为 0,防止出现负刻度
2025-12-04 17:05:36 +08:00
atoz03
4919e392a5
feat: 仪表盘日期筛选默认今日并记忆用户偏好
2025-12-04 16:48:11 +08:00
atoz03
354d8da13f
feat:已修复详情弹窗位置问题:RecordDetailModal 现在 append-to-body、destroy-on-close,并设定 top="10vh",点击列表底部的“详情”不会被滚动容器截断或浮在页面顶部看不到。
2025-12-04 15:17:48 +08:00
atoz03
3df0c7c650
feat:已修复 ESLint no-shadow 问题:geminiApiAccountService 不再重复声明,改用顶部引入的实例。后端/前端 lint 均通过(npm run lint:check、cd web/admin-spa && npm run lint)
2025-12-04 15:05:09 +08:00
atoz03
6a3dce523b
chore: format usage stats route
2025-12-04 15:02:07 +08:00
atoz03
9fe2918a54
feat: keep API key stats modal and add timeline entry point
2025-12-04 14:56:27 +08:00
atoz03
92b30e1924
feat: add API key usage timeline API and admin UI
2025-12-04 14:41:38 +08:00
github-actions[bot]
b63f2f78fc
chore: sync VERSION file with release v1.1.219 [skip ci]
v1.1.219
2025-12-04 01:48:56 +00:00
Wesley Liddick
c971d239ff
Merge pull request #752 from IanShaw027/fix/filter-cloudflare-cdn-headers
...
fix: 过滤 Cloudflare CDN headers 以防止 API 安全检查
2025-12-03 20:48:41 -05:00
Wesley Liddick
01d6e30e82
Merge pull request #751 from atoz03/feature/account-sort-toggle [skip ci]
...
feat(accounts): 支持账户排序正序/倒序切换
2025-12-03 20:48:24 -05:00
IanShaw027
5fd78b6411
fix: 过滤 Cloudflare CDN headers 以防止 API 安全检查
...
使用 Cloudflare 橙色云(CDN 代理模式)时,Cloudflare 会自动添加 CDN 相关的 headers
(cf-*, x-forwarded-*, cdn-loop 等),这会触发上游 API 提供商的安全检查:
1. 已确认问题:88code API 检测到 CDN headers 后返回 403 Forbidden,
导致 Codex CLI 无法使用
2. 潜在风险:其他 API 提供商(OpenAI、Anthropic)可能也会因检测到
代理/CDN 特征而采取限制措施
创建统一的 headerFilter 工具类,在所有转发服务中过滤 Cloudflare CDN headers,
使转发请求伪装成正常的直接客户端请求。
1. 新增 src/utils/headerFilter.js
- 统一的 CDN headers 过滤列表(13 个 Cloudflare headers)
- 提供 filterForOpenAI() 和 filterForClaude() 方法
- 在现有过滤逻辑基础上添加 CDN header 过滤
2. 更新 src/services/openaiResponsesRelayService.js
- 使用 filterForOpenAI() 替代内联的 _filterRequestHeaders()
- 保持向后兼容性
3. 更新 src/services/claudeRelayService.js
- 使用 filterForClaude() 替代 _filterClientHeaders() 实现
- 简化代码,移除重复的 header 列表定义
4. 修复 src/routes/openaiRoutes.js
- 添加对 input 字段的类型检查(可以是数组或字符串)
- 防止 "startsWith is not a function" 错误
x-real-ip, x-forwarded-for, x-forwarded-proto, x-forwarded-host,
x-forwarded-port, x-accel-buffering, cf-ray, cf-connecting-ip,
cf-ipcountry, cf-visitor, cf-request-id, cdn-loop, true-client-ip
- ✅ Codex CLI 通过中转服务成功调用 88code API(之前返回 403)
- ✅ 保留所有业务必需的 headers(conversation_id、session_id 等)
- ✅ 移除所有 Cloudflare CDN 痕迹
- ✅ 保持橙色云的 DDoS 防护和 CDN 加速优势
- ✅ Docker 构建成功
1. 解决 88code 403 问题,Codex CLI 可正常使用
2. 降低因 CDN/代理特征被上游 API 识别的风险
3. 提升与各种 API 提供商的兼容性
4. 统一管理 CDN headers 过滤逻辑,便于维护
2025-12-03 07:07:12 -08:00
atoz03
9ad5c85c2c
feat(accounts): 支持排序切换正序/倒序
...
- 统一下拉选择器和表头的排序变量
- 再次点击同一排序选项/列头时切换排序方向
- 动态更新排序图标指示当前方向
2025-12-03 20:25:26 +08:00
github-actions[bot]
279cd72f23
chore: sync VERSION file with release v1.1.218 [skip ci]
v1.1.218
2025-12-02 12:52:01 +00:00
shaw
81e89d2dc4
feat: 支持sessionKey完成oauth授权
2025-12-02 20:43:47 +08:00
github-actions[bot]
c38b3d2a78
chore: sync VERSION file with release v1.1.217 [skip ci]
v1.1.217
2025-12-01 07:13:46 +00:00
shaw
e8e6f972b4
fix: 增强console账号test端点
2025-12-01 15:08:40 +08:00
shaw
d3155b82ea
style: 优化表格布局
2025-12-01 14:20:53 +08:00
shaw
02018e10f3
feat: 为console类型账号增加count_tokens端点判断
2025-12-01 10:14:12 +08:00
github-actions[bot]
e17cd1d61b
chore: sync VERSION file with release v1.1.216 [skip ci]
v1.1.216
2025-11-30 13:13:59 +00:00
Wesley Liddick
b9d53647bd
Merge pull request #727 from xilu0/main
...
fix: 修复 Claude API 400 错误:tool_result/tool_use 不匹配问题
2025-11-30 08:13:43 -05:00
github-actions[bot]
a872529b2e
chore: sync VERSION file with release v1.1.215 [skip ci]
v1.1.215
2025-11-29 13:31:00 +00:00
shaw
dfee7be944
fix: 调整gemini-api BaseApi后缀以适配更多端点
2025-11-29 21:30:28 +08:00
github-actions[bot]
392601efd5
chore: sync VERSION file with release v1.1.215 [skip ci]
2025-11-29 09:51:09 +00:00
Dave
249e256360
fix: 修复 Claude API 400 错误:tool_result/tool_use 不匹配问题
...
错误信息:
messages.14.content.0: unexpected tool_use_id found in tool_result blocks: toolu_01Ekn6YJMk7yt7hNcn4PZxtM.
Each tool_result block must have a corresponding tool_use block in the previous message.
根本原因:
文件: src/services/claudeRelayService.js 中的 _enforceCacheControlLimit() 方法
原实现问题:
1. 当 cache_control 块超过 4 个时,直接删除整个内容块(splice)
2. 这会删除 tool_use 块,导致后续的 tool_result 找不到对应的 tool_use_id
3. 也会删除用户的文本消息,导致上下文丢失
重要背景(官方文档确认)
根据 Claude API 官方文档:
- 最多可定义 4 个 cache_control 断点
- 如果超过限制,API 不会报错,只是静默地忽略多余的断点
- "20 个块回溯窗口" 是缓存命中检查的范围,与断点数量限制无关
因此,这个函数的原始设计(删除内容块)是不必要且有害的。
修复方案:
保留函数但修改行为:只删除 cache_control 属性,保留内容本身
修改位置;
文件: src/services/claudeRelayService.js
修改内容:
将 removeFromMessages() 和 removeFromSystem() 函数从"删除整个内容块"改为"只删除 cache_control 属性":
// 修改前:直接删除整个内容块
message.content.splice(contentIndex, 1)
// 修改后:只删除 cache_control 属性,保留内容
delete contentItem.cache_control
效果对比;
| 场景 | 修复前 | 修复后 |
|------------|----------------|----------------|
| 用户文本消息 | ❌ 整个消息被删除 | ✅ 保留消息,只移除缓存标记 |
| tool_use 块 | ❌ 被删除导致 400 错误 | ✅ 保留完整内容 |
| system 提示词 | ❌ 整个提示词被删除 | ✅ 保留提示词内容 |
| 缓存功能 | ⚠️ 强制限制 | ✅ 降级(不缓存但内容完整) |
2025-11-29 17:50:45 +08:00
github-actions[bot]
876b126ce0
chore: sync VERSION file with release v1.1.214 [skip ci]
v1.1.214
2025-11-29 06:13:56 +00:00