Wesley Liddick
6c8698f6f9
Merge pull request #1049 from PatchouliTC/fix/allow1mContext-edit-not-save
...
fix: allow1mContext parameter not saved and not add to validated in API key service
2026-03-04 09:00:50 +08:00
PatchouliTC
19e879062e
fix:validateApiKey allow1mContext param
2026-03-03 17:05:19 +08:00
PatchouliTC
aea75b3d8b
fix not save bug:Add 'allow1mContext' to API key service parameters
2026-03-03 16:33:00 +08:00
github-actions[bot]
5fd7bff5a0
chore: sync VERSION file with release v1.1.289 [skip ci]
v1.1.289
2026-03-03 06:34:17 +00:00
shaw
ca02246592
fix: 修复api-stats页面测试返回E015的问题
2026-03-03 14:33:55 +08:00
github-actions[bot]
e5d47edff6
chore: sync VERSION file with release v1.1.288 [skip ci]
v1.1.288
2026-03-03 06:14:25 +00:00
shaw
f0b21fdcc4
fix: 阻止客户端 accept-encoding: zstd 透传到上游导致 JSON 解析失败
...
客户端(Claude Code CLI)发送的 accept-encoding 含 zstd,被透传到上游后
返回 zstd 压缩响应,Node.js 18 无法解压导致 "Failed to parse JSON"。
- headerFilter: 从 filterForClaude 白名单移除 accept-encoding
- claudeCodeHeadersService: 从捕获列表移除 accept-encoding
- claudeRelayService: spread 后强制覆盖 accept-encoding 为 identity,
防御 Redis 旧缓存残留覆盖
2026-03-03 14:12:34 +08:00
shaw
b0842ca927
fix: 修复Extra usage 429标记账号限流的问题
2026-03-03 13:50:47 +08:00
shaw
99dd19b32d
fix: 修复1h缓存定价与sub2api项目对齐
2026-03-03 11:08:13 +08:00
Wesley Liddick
d7b4a54a4c
Merge pull request #1047 from X-Zero-L/fix/claude-account-routing-state-20260302 [skip ci]
...
fix: surface full account routing-block reasons and configurable temp TTL
2026-03-03 08:23:34 +08:00
X-Zero-L
614daec032
style: apply prettier formatting for config example
2026-03-02 22:33:51 +08:00
X-Zero-L
cdaf55bb14
docs: clarify temp-unavailable TTL defaults and account overrides
2026-03-02 22:23:58 +08:00
X-Zero-L
87cbd1897d
refactor: extract temp-unavailable policy and reusable account UI
2026-03-02 22:17:00 +08:00
X-Zero-L
e611f97dae
fix: expose cooldown details and make 503 backoff configurable
2026-03-02 21:53:18 +08:00
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