Wesley Liddick
9517f12cdd
Merge pull request #6510 from wall-wxk/fix/release-session-slot-on-forward-failure
...
fix(gateway): 转发失败的请求立即释放会话槽,不再占用整个空闲超时窗口
2026-09-05 16:05:06 +08:00
Wesley Liddick
c6ff69fd12
Merge pull request #6542 from wucm667/fix/issue-6530-gateway-concurrency-origin
...
fix(handler): distinguish gateway admission rejections
2026-09-05 16:03:17 +08:00
Wesley Liddick
68f099707e
Merge pull request #6553 from wucm667/fix/issue-6547-heartbeat-bootstrap
...
fix(openai): normalize automation heartbeat bootstrap
2026-09-05 16:02:36 +08:00
Wesley Liddick
2ad6e8fb75
Merge pull request #6599 from wucm667/fix/issue-6598-gemini-custom-models-list
...
fix(gemini): apply custom list to native models endpoint
2026-09-05 15:03:08 +08:00
Wesley Liddick
c4e6dcfd80
Merge pull request #6602 from ZeroClover/feat/codex-manifest-pinned-accounts
...
feat(codex): pinned-accounts Codex model manifest for OpenAI groups
2026-09-05 14:51:17 +08:00
Zero Clover
1e28ef5942
feat(codex): pinned-accounts Codex model manifest for OpenAI groups
2026-09-05 00:10:24 +08:00
wucm667
28f673e4cd
fix(gemini): honor custom native models list
2026-09-04 22:29:36 +08:00
feeeei
de27905e88
feat(usage): 用量记录落库上游请求标识并支持按账户配置响应头名
...
- usage_logs 新增 upstream_request_id 列(迁移 232)与仅索引非空行的 CONCURRENTLY 部分索引(迁移 233,runner 登记失效索引清理)
- 账户 extra.upstream_request_id_header 指定要读取的上游响应头,只读该头;留空不记录;创建/更新/批量入口校验头名合法且不超过 64 字节
- ForwardResult/OpenAIForwardResult 携带 UpstreamHeaders,中央计费按账户解析落库,WS 轮次保持 NULL
- 管理端用量明细新增默认隐藏的"上游ID"列,带与请求ID列一致的复制按钮,并同步导出
- 创建/编辑账户弹窗新增"上游ID"输入(UpstreamRequestIdHeaderField),提示按接入类型与平台分条列出常见头名
- HelpTooltip 悬停模式下指针移入提示框时保持打开,便于选中复制提示内容
2026-09-03 18:02:15 +08:00
wucm667
28dde982cb
fix(openai): normalize automation heartbeat bootstrap
2026-09-03 17:29:04 +08:00
wucm667
62198286e9
[verified] fix(handler): distinguish gateway admission rejections
2026-09-03 12:48:02 +08:00
wall-wxk and Claude Opus 4.6
9be9c0b68c
fix(gateway): 转发失败的请求立即释放会话槽,不再占用整个空闲超时窗口
...
会话数量限制(max_sessions)此前只有空闲超时自动过期,没有任何主动释放
机制:请求在选号阶段注册会话后,即使转发失败(上游错误/客户端断开/换号
耗尽),该 session hash 也会占住槽位直到空闲超时(默认 5 分钟),导致
max_sessions 受限的账号在窗口内拒绝所有新会话。
修复:
- SessionLimitCache 新增 UnregisterSession(Redis ZREM),立即移除会话注册
- GatewayService 新增 ReleaseAccountSession,适用条件与 checkAndRegisterSession 对齐
- Messages 主路径:记录 failover 链上注册过会话槽的账号,请求最终失败时
统一释放;failover continue / profit veto / 兜底分组切换时按次即时释放;
成功及"上游已计量部分结果"(#5148)保持既有空闲超时语义
- CountTokens:转发失败时同样释放选号时注册的会话槽
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-09-02 18:45:20 +08:00
刘佳林
77729e2723
merge: resolve conflicts with upstream/main
...
Keep model-scoped reasoning effort mappings together with the
deny-or-downgrade ceiling control that landed on main.
2026-09-02 10:01:42 +08:00
Wesley Liddick
f2804eb2c8
Merge pull request #6444 from Ritel-T/pr/group-free-openai-fast
...
Add group-level Standard billing for OpenAI Fast requests
2026-09-02 09:23:49 +08:00
Wesley Liddick
559960865a
Merge pull request #6447 from DuskLin/feat/openai-reasoning-effort-over-limit
...
feat(groups): 推理强度上限增加超限自动降档与拒绝访问
2026-09-02 09:07:53 +08:00
Wesley Liddick
a4fb58e428
Merge pull request #6443 from Ritel-T/pr/group-openai-fast
...
Add group-level OpenAI Fast enforcement
2026-09-02 09:07:05 +08:00
Wesley Liddick
a668aa8b36
Merge pull request #6460 from HuntercodeT/fix/model-not-found-not-overridden-by-rate-limit
...
fix(gateway): stop a per-model cooldown from turning 404 model_not_found into 429
2026-09-02 09:06:17 +08:00
haruka
34b8bf1a6e
feat: support Claude Fable 5.1
2026-09-02 05:47:01 +08:00
Ritel-T
52c7d88340
chore: merge upstream v0.1.185
2026-09-02 03:29:52 +09:00
Ritel-T
9e2d97f250
chore: merge upstream v0.1.185
2026-09-02 03:28:24 +09:00
HuntercodeT
3438580213
fix(gateway): stop a per-model cooldown from turning 404 model_not_found into 429
...
classifySelectionFailureError upgrades a selection failure to 429
rate_limit_error whenever the scheduler's compact reason string matches
model_rate_limited=(\d+) with a positive count. It does so unconditionally,
including when the fallback it was handed is the authoritative 404
model_not_found classification.
Selection failure reasons are additive, so both can appear at once, e.g.
"pool=9, filtered: model_not_supported=8 model_rate_limited=1": eight accounts
cannot serve the model at all and the ninth happens to sit in a per-model
cooldown. classifyNoAccountError only produces ModelNotFound through
DiagnoseModelAvailabilityForPlatform, a dedicated database query over
persistent eligibility (active + schedulable + model_mapping), so it has
already established that no account in the group can serve the model. One
transient cooldown does not make "All available accounts are currently
rate-limited" true.
The mislabel is not cosmetic:
- Retrying can never succeed, yet 429 explicitly invites a retry.
- Clients that treat 429 as a rate limit retry hard and swallow the body;
Codex surfaces only "exceeded retry limit, last status: 429", discarding the
one message that names the real problem. Operators then look for capacity
and rate limits instead of a model whitelist.
- Ops attribution becomes self-contradictory: classifyNoAccountErrorFromGin
has already marked the request business-limited for local model
configuration, while call sites gate markOpsRoutingCapacityLimitedIfNoAvailable
on ModelNotFound, which the override clears, so the same request is also
counted as routing capacity limited.
Return the fallback untouched when it is ModelNotFound. The 429 upgrade is
preserved for every other fallback, which is the case it was written for:
accounts that can serve the model exist but are all cooling down, where the
fallback is 503 and retrying is meaningful.
Claude-Session: https://claude.ai/code/session_01LwvyJVV2sdqiu41Z9JDNUq
2026-09-01 15:18:30 +08:00
WizardPro
421a83282a
fix(openai): accept scheduled automation bootstrap without call id
2026-09-01 11:36:26 +08:00
刘佳林
aa7a811e66
feat(groups): add deny-or-downgrade control for reasoning effort ceiling
...
OpenAI/Composite groups can now reject requests that exceed the max
reasoning effort instead of always rewriting them down to the ceiling.
Existing groups keep the previous auto-downgrade behavior.
2026-09-01 10:15:45 +08:00
Wesley Liddick
2ac784c51a
Merge pull request #6353 from feeeei/main
...
refactor(billing): 长上下文阶梯计价改为价格目录数据驱动
2026-09-01 09:32:06 +08:00
Wesley Liddick
2d7767eaf2
Merge pull request #6407 from wucm667/fix/issue-6402-delegation-bootstrap
...
fix(openai): accept delegation bootstrap without call id
2026-09-01 08:51:46 +08:00
Wesley Liddick
064d9b74e8
Merge pull request #6432 from okbexx/fix/codex-disabled-account-capabilities
...
fix(codex): ignore persistently disabled catalog accounts
2026-09-01 08:46:42 +08:00
Ritel-T
08d6c153b7
Return free Fast in admin responses
2026-09-01 04:34:24 +09:00
Ritel-T
636d6be690
Expose free Fast in admin requests
2026-09-01 04:34:24 +09:00
Ritel-T
9fba8ed43b
Return group Fast in admin responses
2026-09-01 04:34:06 +09:00
Ritel-T
7f5e915dd1
Expose group Fast in admin requests
2026-09-01 04:34:06 +09:00
feeeei
530fb20f25
refactor(billing): 长上下文阶梯计价改为价格目录数据驱动
...
删除 GPT/Gemini 系列写死的阶梯规则,阶梯一律由目录数据驱动:
- 解析层折算 LiteLLM 的 *_above_XXXk_tokens 绝对价字段为阈值+倍率
(阈值取自字段名,倍率 = above/基础价,cache 侧跟随输入倍率,
xAI 按 provider 用达到即进高档语义);显式 long_context_* 字段
按"字段存在"优先,显式 threshold=0 或 multiplier=1 可关闭阶梯
- 删除 OpenAI 272K 常量与 applyModelSpecificPricingPolicy 的长上下文
强补分支、fallbackPrices/静态兜底条目的 LongContext 字段、Gemini 旧
边际规则全链路(CalculateCostWithLongContext / RecordUsageWithLongContext /
阶梯表 marginal 基准);保留 fastRatio 与 GPT-5.6 cache_write 1.25x
防御分支、grok 静态兜底阶梯
- 渠道配置定价区间时完全以渠道区间为准,不再叠加目录阶梯
- 长上下文倍率 ≤0 在应用点按 1 计,防止显式字段残缺把分项乘 0 免费
- 目录重载时对比新旧数据,原有阶梯丢失打 WARN 哨兵告警
行为变化:Gemini 由边际 2x(仅 /v1beta、全模型)改为整单换档(数据
驱动、仅带 above_200k 的 pro 系),渠道平价之上叠加目录阶梯;Claude
sonnet-4/4.5 随目录数据获得 200K 整单阶梯(与官方定价一致);模型广场
官方参考价列与实付列同源展示目录阶梯。
2026-09-01 01:26:55 +08:00
Brisbanehuang
e2624fb65c
fix(codex): preserve known image input capabilities
2026-08-31 09:42:58 -04:00
Jarl
ba345f1052
fix(codex): ignore persistently disabled catalog accounts
2026-08-31 20:26:29 +08:00
刘佳林
7c01ec9be8
feat(groups): scope OpenAI reasoning effort mappings by model
...
Allow OpenAI/Composite group mappings to match by exact model name,
prefix, or suffix. Empty type and model still apply to every model.
The admin form groups multiple request-to-forward pairs under one
type+model scope.
2026-08-31 19:21:31 +08:00
shaw
c66e700f05
fix(openai): move TTFT metric mode to admin settings
2026-08-31 14:52:07 +08:00
wucm667
1be69e56aa
fix(openai): accept delegation bootstrap without call id
2026-08-31 12:57:06 +08:00
Wesley Liddick
0678b24d58
Merge pull request #6283 from okbexx/feat/usage-compaction-kind
...
feat(usage): track native compaction requests
2026-08-31 11:19:37 +08:00
Wesley Liddick
03ab687686
Merge pull request #5866 from wucm667/fix/issue-5863-scope-monitor-groups
...
fix: scope channel monitor groups by user access
2026-08-31 11:15:13 +08:00
Wesley Liddick
fbc69322af
Merge pull request #6254 from wucm667/fix/issue-6249-configurable-image-cooldown
...
feat(openai): configure image tool cooldown
2026-08-31 11:13:52 +08:00
wucm667
9f1effd71c
fix(admin): preserve quota limits on partial group updates
2026-08-30 16:36:13 +08:00
wucm667
a3bbf33c05
fix(monitor): scope groups by user access
2026-08-30 09:28:40 +08:00
wucm667
c31fe2ed9e
fix(admin): preserve saved SMTP TLS mode in test endpoints
...
保留测试邮件端点已保存的 SMTP TLS 配置,区分省略与显式 false。
2026-08-29 17:28:00 +08:00
Wesley Liddick
ac18c588c8
Merge PR #6165
...
修复上游倍率探测导致账号列表整页刷新的问题
2026-08-29 09:12:05 +08:00
RayWangX
5688bcba91
fix(openai): honor Claude Code session for messages sticky routing
2026-08-29 08:31:15 +08:00
Jarl
1cc6999ada
feat(usage): track native compaction requests
2026-08-28 23:32:11 +08:00
Wesley Liddick
7b693ae429
Merge pull request #6188 from JialinLiu-codedance/feat/usage-requested-reasoning-effort
...
feat(usage): 使用记录展示映射前的推理强度
2026-08-28 16:18:50 +08:00
Wesley Liddick
1e6926cb9c
Merge pull request #6312 from fengshao1227/fix/openai-ws-client-close-not-account-failure
...
fix(openai): 入站 WS 的客户端正常关闭与断开不再计为账号故障
2026-08-28 15:56:34 +08:00
li
c83dced4ba
fix(openai): 入站 WS 的客户端正常关闭与断开不再计为账号故障
...
ingress WebSocket 收尾处只把 *service.OpenAIWSClientCloseError 且状态码为 1000
的情况认作正常关闭,其余全部落到 shouldReportOpenAIWSProxyAccountFailure ——
而它只排除 model-switch 与 session-preempted 两种。两种完全正常的结束因此被
误判为上游/账号故障:
- 客户端干净关闭:coder/websocket 直接回裸 coderws.CloseError{Code: 1000},
ReadOpenAIWSClientMessage 把 conn.Read 的错误原样返回,没有任何一层把它包成
*OpenAIWSClientCloseError,所以 errors.As 对该类型必然为假。
- 客户端中途断开:ReadOpenAIWSClientMessage 在 controlCtx.Done() 分支用
StatusGoingAway(1001) 收尾并以 context.Canceled 为 cause,「只认 1000」匹配不到。
两者都会走到 ReportOpenAIAccountScheduleResult(success=false),进而喂给
ObserveOpenAIAPIKeyHealthFailure 与 scheduler.ReportResult,累积到阈值即把上游
账号熔断出调度池——客户端按一次 Ctrl-C 就在扣上游账号的健康分。
同文件的 summarizeWSCloseErrorForLog 一直用 coderws.CloseStatus 读关闭码,就在
该判断之后 12 行被调用,于是同一条 WARN 会打印
close_status=1000(StatusNormalClosure) 的同时把账号记为故障。
失败归因的政策仓库早有明文:同包 failover_loop.go 的 failoverClientGone 写着
「客户端断开后 failover 必须静默终止……并被误报成账号耗尽」。本次把 WS ingress
补齐到同一条规矩。
判定收窄:只豁免 1000 与 context.Canceled。1001 不整类放行——网关也会因自身原因
用 GoingAway 收场,客户端取消那一支已由 context.Canceled 覆盖;
context.DeadlineExceeded 同样不放行,空闲超时那条本就被包成 1000 走前一个判据,
其余 deadline 是真实停滞。
Fixes #6105
2026-08-28 13:17:43 +08:00
Wesley Liddick
d674a04f2a
Merge branch 'main' into feat/per-user-public-group-access
2026-08-28 13:08:41 +08:00
Wesley Liddick
add86cc3bc
Merge branch 'main' into fix/openai-reset-usage-sync
2026-08-28 12:57:48 +08:00
Wesley Liddick
b588c0bc42
Merge branch 'main' into fix/ws-v2-passthrough-cyber
2026-08-28 12:36:22 +08:00