li
02fbcbe3ad
fix(ratelimit): 守卫按端点来源门控,并与冷却键对齐模型口径
...
上一版守卫只看模型类型,不区分请求从哪个端点进来。OAuth 账号的 /v1/images/*
上游同样是 Codex Responses(openai_images_responses.go → handleOpenAIImagesErrorResponse
→ handleOpenAIAccountUpstreamError → HandleUpstreamModelNotFound),所以专用生图
端点也会命中 plan-gated 分支。账号确实不具备生图能力时跳过冷却,会让调度层失去
唯一的刹车:每个请求都完整走一遍号池,对上游形成无上界的 400 放大。
改动:
- 新增 ctxkey.OpenAIImagesEndpoint 与 WithOpenAIImagesEndpoint /
OpenAIImagesEndpointFromContext,在 handler/openai_images.go 入口置位;
与 OpenAIImageGenerationIntent 区分——后者在 /v1/responses 带图片模型时也会置位。
- 守卫下移到 modelKey 计算之后,抽成 shouldSkipCodexPlanGatedImageModelCooldown,
仅在 plan-gated 分支、且非 /v1/images/* 入站时生效。
- 同时判断 requestedModel 与最终 modelKey:冷却键走 account.GetMappedModel,
账号可以把文本别名映射到 gpt-image-*,只判请求模型会漏掉这种形态。
2026-08-07 20:49:39 +08:00
li
b5d9fd21b0
fix(ratelimit): 图片模型被 Codex 文本端点拒绝时不再写模型冷却
...
gpt-image-* 被误发到 /v1/chat/completions 或 /v1/responses 时,Codex 会稳定
返回 400 codex_plan_gated_model。HandleUpstreamModelNotFound 把它当成账号能力
缺失,给每个账号写 30 分钟 model_rate_limits 冷却。failover 走完整个号池后,
池内每个账号都冷却了该图片模型,于是后续走对端点的 /v1/images/generations
请求也一并 503 no available accounts。
在 codex plan-gated 分支里对图片模型提前返回:仍然 failover 掉本次尝试,
但跳过 SetModelRateLimit 写入,不把号池对正确的生图请求整体下线。
Fixes #4828
2026-08-07 20:41:34 +08:00
Wesley Liddick
b8c0c00091
Merge pull request #5384 from fengshao1227/fix/ops-system-log-sink-flush-backoff
...
fix(ops): 系统日志落库失败后退避重试,避免拖垮数据库连接池
2026-08-07 20:20:20 +08:00
Wesley Liddick
bd9b12bbcb
Merge pull request #5380 from Wei-Shaw/fix/subscription-daily-midnight-reset
...
fix(subscription): 恢复日额度每天 0 点重置,修复手动重置后刷新时刻漂移
2026-08-07 19:49:08 +08:00
li
e687ca3e9d
fix(ops): 系统日志落库失败后退避重试,避免拖垮数据库连接池
...
OpsSystemLogSink 的 flush 没有任何失败退避:ticker 每 1 秒触发一次,每次都
带 5 秒超时打一批 COPY,失败后立刻在下一个 tick 再来一次。远程 PostgreSQL 上
COPY 被 context 取消会导致协议失步、连接被服务端 FATAL 终止,于是这条循环
变成持续的「占用连接 → 超时取消 → 销毁重建」;在 max_open 较小的连接池里,
日志通道会长期占满连接,业务侧最终报 Billing 503。
改为连续失败后指数退避(2s 起,翻倍,封顶 60s):
- 退避窗口内直接丢弃当前批次并计入 dropped_count,不再触达数据库;
- 任意一次成功立即清空失败计数与抑制窗口;
- 失败日志随退避天然收敛为每个窗口至多一条,并附带 failures/backoff。
Fixes #5265
2026-08-07 18:45:05 +08:00
shaw
99b357083e
fix(subscription): restore midnight daily quota reset
...
日额度窗口恢复日历日语义(配置时区每天 0 点刷新),修复 v0.1.170 引入的回归:
- 手动重置配额后日窗口锚点漂移到重置时刻,此后 0 点不再刷新
- 新建/续费订阅日窗口按购买或首用时刻滚动,而非 0 点刷新
日窗口三处锚点(激活/手动重置/续期)统一写入当天 0 点,自动重置改为跨日历日
边界触发;存量非 0 点锚点在下一个 0 点自愈,无需数据库迁移。周/月窗口保持
期限对齐滚动语义(含到期约束)不变,不回归 issue #5051 的月额度翻倍问题。
日卡一次性额度豁免逻辑保留。
2026-08-07 17:42:51 +08:00
Wesley Liddick
32e4de7942
Merge pull request #5231 from fengshao1227/fix/upstream-dial-timeout
...
fix(upstream): set explicit TCP dial timeout on upstream transports
2026-08-07 16:24:53 +08:00
Wesley Liddick
8f55e0a7cd
Merge pull request #5267 from wucm667/fix/issue-5264-model-plaza-composite
...
fix(model-plaza): show Composite group models
2026-08-07 16:17:52 +08:00
Wesley Liddick
5ec11885d1
Merge pull request #5307 from lenzhang/fix/ws-prewarm-continuation
...
fix(ws): allow Codex prewarm continuation
2026-08-07 16:15:11 +08:00
Wesley Liddick
c8af48d769
Merge pull request #5315 from wucm667/fix/issue-5312-ops-custom-error-range
...
fix(ops): preserve custom range in error lists
2026-08-07 16:15:00 +08:00
Wesley Liddick
dce0f6b4e3
Merge pull request #5337 from wucm667/fix/issue-5331-oauth-count-tokens-fallback
...
fix: avoid cooling OAuth accounts for HTML count token errors
2026-08-07 16:14:48 +08:00
Wesley Liddick
22ef761c27
Merge pull request #5309 from wucm667/fix/issue-5308-antigravity-gemini36
...
fix(antigravity): support Gemini 3.6 Flash models
2026-08-07 16:14:37 +08:00
Wesley Liddick
865002fd2c
Merge pull request #5317 from wucm667/fix/issue-5314-grok-video-task-id
...
fix(grok): bind video owners for task_id receipts
2026-08-07 16:14:25 +08:00
Wesley Liddick
93367b6db4
Merge pull request #5351 from Wei-Shaw/fix/codex-tui-default-identity
...
fix(openai): default OAuth identity to codex-tui
2026-08-07 10:17:00 +08:00
shaw
b6e53c9320
fix(frontend): align Codex UA setting copy
2026-08-07 10:06:28 +08:00
shaw
dbb42881c0
fix(openai): default OAuth identity to codex-tui
2026-08-07 09:56:03 +08:00
Wesley Liddick
e4b0e1b66b
Merge pull request #5338 from Wei-Shaw/fix/tencent-captcha-region-csp
...
修复腾讯验证码区域适配、重置与 CSP 加载
2026-08-07 08:37:50 +08:00
shaw
287a9f386b
fix: 修复腾讯验证码票据过期与区域切换
2026-08-06 21:27:06 +08:00
shaw
8e102b3a0f
fix: 完善腾讯验证码区域适配与 CSP 白名单
...
修复国内站和国际站 SDK 构造、验证容器、票据重置及动态资源加载问题,并补充认证流程回归测试。
2026-08-06 20:34:37 +08:00
wucm667
e93f6b9953
fix: avoid cooling OAuth accounts for HTML count token errors
2026-08-06 20:31:56 +08:00
shaw
a19c9f8d8a
chore: update sponsors
2026-08-06 19:31:17 +08:00
shaw
a1936d42db
chore: update sponsors
2026-08-06 19:30:44 +08:00
shaw
c123caddd4
chore: update sponsors
2026-08-06 14:22:46 +08:00
Wesley Liddick
e08aee49ed
Merge pull request #5266 from shentry/fix/transient-streak-rate-dependence
...
fix(openai): keep transient failure streak from resetting on sparse traffic
2026-08-06 14:11:49 +08:00
Wesley Liddick
c9e60d1f26
Merge pull request #5031 from keaipiao/fix/easypay-error-utf8
...
fix(payment): preserve UTF-8 in EasyPay errors
2026-08-06 14:10:41 +08:00
Wesley Liddick
47c03c75d8
Merge pull request #5232 from fengshao1227/fix/billing-quantize-monetary-scale
...
fix(billing): quantize usage billing amounts to the NUMERIC(20,8) scale
2026-08-06 14:00:04 +08:00
wucm667
5b7a64334f
fix(grok): support task IDs for video owner binding
2026-08-06 04:30:10 +08:00
wucm667
82ccc187cd
fix(ops): preserve custom range in error lists
2026-08-06 02:26:42 +08:00
wucm667
ce14983133
fix(antigravity): support Gemini 3.6 Flash models
2026-08-05 22:35:01 +08:00
必通
fc5a1b78d2
fix(ws): allow Codex prewarm continuation
2026-08-05 21:26:37 +08:00
shaw
00b8596176
chore: update sponsors
2026-08-04 21:55:34 +08:00
shaw
c5e046b7d7
chore: update sponsors
2026-08-04 21:54:50 +08:00
github-actions[bot]
aac53afe0e
chore: sync VERSION to 0.1.171 [skip ci]
2026-08-04 13:41:47 +00:00
Wesley Liddick
f0e7a9c7a2
Merge pull request #5223 from feeeei/main
...
feat(aliyun-captcha): 人机验证增加阿里云验证码 2.0
v0.1.171
2026-08-04 21:16:43 +08:00
feeeei
26e0a89323
人机验证增加阿里云验证码 2.0
...
沿用腾讯天御验证码引入的多服务商模型:aliyun_captcha_enabled 作为独立
开关,与 Cloudflare Turnstile、腾讯天御三方互斥(保存校验 + 运行时
CAPTCHA_PROVIDER_CONFLICT)。后台「安全与认证」合并为单张人机验证卡片:
总开关 + 服务商单选(Turnstile / 腾讯天御 / 阿里云),选中即启用该家并
关闭其它,落库仍是三个独立开关键,由前端映射保证互斥。
阿里云侧同时支持 aliyun 中国站与国际站(alibabacloud.com):两站前端脚本、
region 取值与服务端 API 完全一致,仅账号与 AccessKey 相互独立,因此由
「服务地域」决定线路即可——中国内地走 captcha.cn-shanghai.aliyuncs.com,
非中国内地(新加坡)走 captcha.ap-southeast-1.aliyuncs.com,AccessKey
取自持有该实例的账号,无需在配置中区分站点。
- AliyunCaptchaService 对称 TencentCaptchaService:服务端校验走官方 SDK
VerifyIntelligentCaptcha,调用异常按 fail-closed 拦截,与 Turnstile
网络错误行为对称;保存设置时真实探测 AK/SK 有效性
- 保护面对齐腾讯扩展入口:VerifyTencentCaptchaIfEnabled 通用化为
VerifyActionCaptchaIfEnabled,OAuth 登录启动、passkey 登录在阿里云
启用时同样拦截;Turnstile 维持既有覆盖不扩大
- 前端 AliyunCaptchaWidget 为表单内预验证按钮(popup 模式),同时暴露
verify() 供 OAuth 启动、passkey 等动作入口程序化弹窗;未预验证直接
提交时弹窗兜底。SDK 按钮绑定异步完成,弹窗未出现前按 tick 重试触发,
并轮询弹窗可见性识别用户关闭
- captchaVerifyParam 复用 turnstile_token 请求字段提交;公开设置下发
aliyun_captcha_enabled / scene_id / prefix / region
- CSP 放行验证码 CDN:script-src/style-src 加 *.alicdn.com
2026-08-04 20:57:15 +08:00
Wesley Liddick
d431c57f2e
Merge pull request #5268 from Wei-Shaw/fix/pending-oauth-captcha-submit-gate
...
fix(auth-ui): 第三方 OAuth 建号提交前必须持有验证码票据
2026-08-04 20:43:01 +08:00
shaw
635a27189f
fix(auth-ui): gate pending OAuth account creation on a captcha proof
...
#5261 added a captcha check to POST /auth/oauth/pending/create-account, but
the shared create-account form only gates its send-code button on the
Turnstile token — the submit button's disabled condition never included it.
Turnstile tokens are single-use, so handleSendCode resets the widget in its
finally block and clears the token. Submitting inside the window before the
widget re-solves omits turnstile_token from the payload, and the backend
answers ErrTurnstileVerificationFailed (turnstile_service.go:65). With an
interaction-required challenge the widget does not re-solve on its own, so
the failure persists until the user notices and verifies again — while the
button stays enabled and says nothing.
Gate the submit button on the token, mirroring the send-code button and
EmailVerifyView, which already gates its pending-OAuth submit the same way.
handleSubmit repeats the check because implicit form submission (Enter in a
text input) bypasses the button's disabled state.
The Tencent path is unaffected: handleSubmit already acquires a fresh proof
per submit, and turnstile_enabled is false in that configuration.
Verified with the component spec (11 passed) and vue-tsc --noEmit (clean).
2026-08-04 20:29:53 +08:00
wucm667
d3b5703b55
fix(model-plaza): show composite group models
2026-08-04 19:14:28 +08:00
shentry and Claude Opus 5
7d38e67120
fix(openai): keep transient failure streak from resetting on sparse traffic
...
The account+model transient breaker reset its failure streak whenever the
gap since the previous failure exceeded a one-minute window. That made the
breaker's sensitivity a function of request rate rather than upstream
health: a gateway called less often than once a minute never advanced past
streak 1, where the cooldown is zero, so a consistently broken account was
never blocked. Every request re-selected it, paid a full upstream attempt,
and only then failed over to a healthy account.
Observed on a low-traffic deployment: two accounts returning 500 and 503
stayed in rotation indefinitely, logging `failure_streak: 1, cooldown_ms: 0`
on every request and adding ~750ms to each one before a working account was
reached.
The streak is already cleared on success — recordSuccess deletes the entry,
and every OpenAI handler reports the schedule result — so the time-based
reset is not needed to recover a healthy account. Keep a TTL purely to bound
the map for account+model pairs that stopped being used, and raise it well
above the cooldowns so it no longer doubles as a streak reset.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com >
2026-08-04 17:59:16 +08:00
Wesley Liddick
8b3fe664dc
Merge pull request #5261 from lyen1688/feat/tencent-captcha-gate
...
新增腾讯天御验证码认证门禁
2026-08-04 16:39:55 +08:00
Wesley Liddick
a4d263f62f
Merge pull request #5224 from wucm667/fix/issue-5190-lock-subscription-renewal
...
fix(subscription): serialize concurrent renewals
2026-08-04 16:28:52 +08:00
Wesley Liddick
ae81dfd933
Merge pull request #5177 from r266-tech/fix-nonpassthrough-write-context
...
fix(openai-ws): preserve terminal event on lease loss
2026-08-04 16:28:22 +08:00
Wesley Liddick
35cab3c814
Merge pull request #5258 from feeeei/fix/model_plaza
...
fix(model-plaza): Model Plaza image model price display is inconsistent with the actual price
2026-08-04 16:27:53 +08:00
Wesley Liddick
770e35b474
Merge pull request #5040 from coo1white/upstream-pr/grok-cli-0.2.114
...
fix(grok): bump pinned Grok CLI version to 0.2.114
2026-08-04 16:16:20 +08:00
Wesley Liddick
846dd310a3
Merge pull request #5158 from neboyang/feat/claude-oauth-authorize-url
...
fix(oauth): use claude.com/cai authorize endpoint
2026-08-04 16:15:50 +08:00
Wesley Liddick
9b4575e434
Merge pull request #5243 from wucm667/feat/issue-5240-dashboard-username
...
fix(dashboard): show usernames in spending ranking
2026-08-04 16:15:21 +08:00
Wesley Liddick
1f4cfc44c1
Merge pull request #5226 from spongehah/codex/fix-prompt-audit-output-text
...
fix(prompt-audit): parse responses output text
2026-08-04 16:15:04 +08:00
lyen1688
e592c5f9e0
新增腾讯天御验证码认证门禁
2026-08-04 15:09:29 +08:00
Wesley Liddick
9fd7e76231
Merge pull request #5233 from Wei-Shaw/fix/codex-identity-enforcement
...
fix(codex): 强制统一出站身份并让客户端版本号跟随官方发布
2026-08-04 14:50:44 +08:00
feeeei
785b61d424
修复模型广场图片模型价格展示与实收口径不一致
...
图片计费模型的广场展示价按实收口径计算:档位单价取
分组图片价 > 渠道档位价 > 渠道默认按次价;分组开启生图
独立倍率时实付倍率取独立倍率,不取分组/专属倍率。
2026-08-04 13:48:19 +08:00