X-Zero-L
96706c27f6
fix: surface account routing-block reasons and harden claude reset-state
2026-03-02 21:43:16 +08:00
Wesley Liddick
b38a92106c
Merge pull request #1046 from yptse123/feat/per-key-1m-context-control [skip ci]
...
feat: 按 API Key 控制 1M 上下文窗口访问权限
2026-03-02 20:43:52 +08:00
Wesley Liddick
4f0487981e
Merge pull request #1042 from learnerLj/fix/claude-console-test-model [skip ci]
...
fix: respect selected model in claude-console connectivity test
2026-03-02 20:28:20 +08:00
yptse123
b2e4187ea3
fix: 移除 1M 上下文的账户类型限制,信任 admin 的 allow1mContext 授权
...
部分 Claude 订阅类型(Pro/Team/Enterprise)原生支持 1M 上下文,
之前的实现仅允许 Bedrock 账户类型通过,过于保守。
现在当 admin 为 API Key 启用 allow1mContext 后,任何账户类型
(claude-official、claude-console、bedrock)均可使用 1M 上下文。
2026-03-02 17:12:44 +08:00
yptse123
5d3456911b
feat: 支持按 API Key 控制 1M 上下文窗口访问
...
改进 PR #1016 的全局拦截逻辑,将 1M 上下文窗口(context-1m)的拦截
从全局一刀切改为按 API Key 精细控制。
新增 `allow1mContext` 布尔字段,默认 false(向后兼容)。管理员可在
创建/编辑 API Key 时为需要的用户单独开启 1M 上下文窗口权限。
双层保护机制:
- 第一层:API Key 未启用 allow1mContext 时直接返回 403
- 第二层:已启用但调度到的账户类型不支持 1M(非 Bedrock)时返回 403
修改文件:
- src/models/redis.js: 新增 allow1mContext 布尔字段解析
- src/services/apiKeyService.js: 创建 Key 时支持 allow1mContext 参数
- src/middleware/auth.js: 将 allow1mContext 附加到 req.apiKey
- src/routes/admin/apiKeys.js: 创建/批量创建/更新/批量更新接口支持
- src/routes/api.js: 替换全局拦截为按 Key + 账户类型双层检查
- CreateApiKeyModal.vue: 新增"允许 1M 上下文"复选框
- EditApiKeyModal.vue: 新增复选框,支持从已有数据加载
- BatchEditApiKeyModal.vue: 新增三态单选(启用/禁用/不修改)
2026-03-02 17:08:17 +08:00
Wesley Liddick
bdbe728e9a
Merge pull request #1041 from X-Zero-L/feat/codex-api-configurable-endpoint [skip ci]
...
feat: configurable provider endpoint for codex-api accounts
2026-03-02 16:23:55 +08:00
Jiahao Luo
c31b4f4504
test: fix eslint arrow-body-style in claude-console account tests
2026-03-02 16:10:34 +08:00
Jiahao Luo
b78cd35f8b
style: format claude-console relay changes
2026-03-02 15:35:56 +08:00
Jiahao Luo
1813d6f6f6
feat: add claude sonnet 4.6 model option for tests
2026-03-02 15:34:56 +08:00
Jiahao Luo
b8c38adf70
fix: align claude-console test auth with relay logic
2026-03-02 15:34:56 +08:00
Jiahao Luo
f77a76ce1d
test: make claude-console relay test portable
2026-03-02 15:34:56 +08:00
Jiahao Luo
adf2dd61e0
fix: use selected model in claude-console connectivity test payload
2026-03-02 15:34:56 +08:00
Jiahao Luo
75515f92e6
test: cover claude-console test route model pass-through
2026-03-02 15:34:56 +08:00
Jiahao Luo
2263977cef
fix: require model for claude-console account test endpoint
2026-03-02 15:34:56 +08:00
Zero
90209455ac
Merge branch 'Wei-Shaw:main' into feat/codex-api-configurable-endpoint
2026-03-02 14:57:42 +08:00
X-Zero-L
8fed791702
fix: use template literal to satisfy ESLint prefer-template rule
...
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-02 14:52:16 +08:00
github-actions[bot]
bf0f365cff
chore: sync VERSION file with release v1.1.287 [skip ci]
v1.1.287
2026-03-02 06:29:01 +00:00
Wesley Liddick
7832571e8f
Merge pull request #1039 from atian8179/fix/sse-stream-gzip-corruption
...
fix: prevent SSE stream corruption by requesting identity encoding
2026-03-02 14:28:49 +08:00
X-Zero-L
8c332086ba
fix: harden provider endpoint - remove broken completions mode, add validation
...
- Remove `completions` option (path-only change without body conversion causes 400)
- Add server-side enum validation for providerEndpoint in create/update
- Use exact path matching instead of broad `.includes()` in relay service
- Fix test endpoint to respect providerEndpoint config and /v1 dedup
- Improve /v1 dedup with null-safe baseApi access
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-01 20:33:26 +08:00
X-Zero-L
0831739f4b
feat: add configurable provider endpoint for codex-api accounts
...
Add providerEndpoint field (responses/completions/auto) to openai-responses
accounts, allowing admins to specify which API endpoint format the provider
supports. The relay service normalizes request paths based on this config:
- responses (default): routes all requests to /v1/responses
- completions: routes all requests to /v1/chat/completions
- auto: preserves the original request path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-01 19:48:17 +08:00
atian8179
4d5ea4e0bc
fix: prevent SSE stream corruption by requesting identity encoding
...
Add 'accept-encoding: identity' to upstream request headers to prevent
Cloudflare/Anthropic CDN from returning gzip-compressed SSE responses.
When the upstream returns gzip data without a Content-Encoding header
(observed with some CDN edge configurations), the stream handler's
chunk.toString() call decodes raw gzip bytes as UTF-8, replacing any
byte >= 0x80 that isn't valid UTF-8 with U+FFFD (ef bf bd). This
silently corrupts the entire SSE stream.
Explicitly requesting identity encoding is the simplest and most
reliable fix — it prevents compression at the source rather than
trying to detect and decompress it after the fact.
Closes #1030
2026-03-01 15:19:38 +08:00
github-actions[bot]
0871101f27
chore: sync VERSION file with release v1.1.286 [skip ci]
v1.1.286
2026-02-27 05:43:33 +00:00
shaw
02f3e3335c
chore: remove files
2026-02-27 13:43:12 +08:00
github-actions[bot]
ef4de775f0
chore: sync VERSION file with release v1.1.285 [skip ci]
v1.1.285
2026-02-27 03:43:23 +00:00
Wesley Liddick
f603510240
Merge pull request #1028 from nanobanana123/fix/stream-gzip-decompression
...
fix: 解压 streaming 响应的 gzip 压缩,修复 SSE 数据损坏
2026-02-27 11:43:09 +08:00
github-actions[bot]
96ed57e0f4
chore: sync VERSION file with release v1.1.284 [skip ci]
v1.1.284
2026-02-27 03:26:17 +00:00
Wesley Liddick
afb8041c4a
Merge pull request #1024 from SunSeekerX/feat/oai_optimize2
...
Title: feat: 账户错误历史记录 + 完善 disableAutoProtection 覆盖
2026-02-27 11:26:04 +08:00
Xiaoyong
210eba4a46
fix: 解压 streaming 响应的 gzip 压缩,修复 SSE 数据损坏
...
Anthropic API (经 Cloudflare) 返回 Content-Encoding: gzip 的压缩响应。
非 streaming 处理器已有 zlib.gunzipSync 解压,但 streaming 处理器
直接对 gzip 二进制数据调用 chunk.toString(),导致非法 UTF-8 字节
被替换为 U+FFFD,SSE 数据损坏。
修复:在 streaming 的 res.on('data') 之前检测 content-encoding,
如为 gzip/deflate 则通过 zlib 管道解压后再处理。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-02-27 11:16:42 +08:00
SunSeekerX
0711b0fd25
1
2026-02-26 23:10:03 +08:00
SunSeekerX
b5f24d04a3
1
2026-02-26 23:07:19 +08:00
github-actions[bot]
6aa416e2fc
chore: sync VERSION file with release v1.1.283 [skip ci]
v1.1.283
2026-02-26 01:00:31 +00:00
Wesley Liddick
dab67432a8
Merge pull request #1016 from yuanhaitao/fix/block-1m-context-window
...
fix: 拦截 1M 上下文窗口请求,避免账户被误标记为限流
2026-02-26 09:00:14 +08:00
Wesley Liddick
d2dc02a414
Merge pull request #1013 from DragonFSKY/fix/unified-gemini-standard-handler [skip ci]
...
fix: 切换 /v1/chat/completions Gemini 处理器为 standard 版本,支持 API Key 账户
2026-02-26 09:00:06 +08:00
Wesley Liddick
198db9d2af
Merge pull request #1015 from DragonFSKY/feat/unified-endpoint-response-format [skip ci]
...
feat: /v1/chat/completions 返回标准 OpenAI Chat Completions 格式
2026-02-26 08:59:31 +08:00
yuanhaitao
81c7a207f3
fix: 拦截 1M 上下文窗口请求,避免不支持的账户被误标记为限流
...
当客户端使用 [1m] 模型时,请求会携带 anthropic-beta: context-1m 头。
部分账户订阅(如 Max)不支持 1M 上下文,上游返回 429 后系统会误将
账户标记为限流,导致后续所有请求被拦截。
现在在路由层直接检测 context-1m beta header,返回 403 提示用户
切换模型,不转发请求、不触发限流标记。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-25 23:27:53 +08:00
shaw
68d1391bca
fix: 更新上游模型定价文件
2026-02-25 15:29:32 +08:00
github-actions[bot]
0901a27a6a
chore: sync VERSION file with release v1.1.282 [skip ci]
v1.1.282
2026-02-25 02:29:54 +00:00
Wesley Liddick
b5425f1df7
Merge pull request #1009 from sczheng189/feature/claude_price_count
...
claude计费相关修改
2026-02-25 10:29:38 +08:00
Wesley Liddick
11a1925a13
Merge pull request #1008 from DragonFSKY/fix/sticky-session-temp-unavailable-fallback [skip ci]
...
fix: 补全账户临时不可用检查,修复粘性会话不自动切换
2026-02-25 10:29:26 +08:00
谢栋梁
a6f8800630
feat: 统一端点返回标准 OpenAI Chat Completions 格式
...
为 unified /v1/chat/completions 端点添加双向格式转换:
- Codex: Chat Completions 请求转 Responses API 格式,响应转回 Chat Completions(流式+非流式)
- Gemini: 原生响应转为标准 OpenAI Chat Completions 格式(流式+非流式)
- 工具名 64 字符缩短与逆向恢复,非 function 工具原样透传
- 注入 Codex CLI 系统提示词,与 handleResponses 适配行为一致
2026-02-24 23:47:15 +08:00
sczheng189
a3d6b44f01
refactor: 重构 Fast Mode 相关逻辑
2026-02-24 23:35:00 +08:00
谢栋梁
5b01838eea
fix: 切换统一端点 Gemini 处理器为 standard 版本,支持 API Key 账户
2026-02-24 23:32:08 +08:00
谢栋梁
bd437e29f2
fix: 补全账户临时不可用检查,修复粘性会话及池选择不自动切换的问题
...
_isAccountAvailable()、_getAllAvailableAccounts() 专属账户优先分支、
selectAccountFromGroup() 和 _getAvailableCcrAccounts() 均缺少
isAccountTemporarilyUnavailable() 检查,导致账户被 markTempUnavailable
标记后仍可能被选中,粘性会话不回退、池选择不排除。
本次在所有缺失路径统一补充该检查,与已有的共享池选择逻辑对齐。
2026-02-24 22:26:36 +08:00
sczheng189
4b220263eb
fix: 增强限流跟踪逻辑,支持预计算费用的传递,修复窗口限制计费错误
2026-02-24 18:17:25 +08:00
sczheng189
915544cc73
feat: 增强费用计算逻辑,支持实时和存储费用的处理
2026-02-24 16:59:59 +08:00
github-actions[bot]
5d0c8144dd
chore: sync VERSION file with release v1.1.281 [skip ci]
v1.1.281
2026-02-24 02:05:39 +00:00
shaw
ba7024a8dc
fix: 修复claude code客户端system billing-header部分的判断
2026-02-24 10:05:16 +08:00
Wesley Liddick
8b684117af
Merge pull request #996 from yptse123/feat/per-key-weekly-reset-time [skip ci]
...
feat: add per-API-key weekly cost reset day/hour configuration
2026-02-24 08:53:47 +08:00
Wesley Liddick
0b7a2aa9a2
Merge pull request #981 from codsaf/fix/gemini-stream-usage [skip ci]
...
fix(gemini): resolve stream usage data loss due to split chunks
2026-02-24 08:53:27 +08:00
Wesley Liddick
66f5208de0
Merge pull request #979 from Jackwwg83/fix/enterprise-profile-account-type [skip ci]
...
Fix Claude Enterprise account type detection from OAuth profile
2026-02-24 08:52:25 +08:00