DaydreamCoding and Claude Opus 4.8
819fda34d9
feat(codex-detect): codex_cli_only 检测加固 + 引擎指纹统一信号列表 + 账号级 app-server
...
将 codex_cli_only 客户端识别从「单一 strict 开关 + 固定 OR 头集合」重构为
可逐项管理的引擎指纹信号列表,加固整条判定链,并补齐账号级 app-server 控制、
对齐前端设置文案。
判定链(每步可短路):
- 账号未开 codex_cli_only → 不限制;gateway.force_codex_cli → 旁路放行
- 全局黑名单命中(OR 宽 deny)→ 立即拒
- 身份候选:官方 UA(strict,仅前缀)/ 官方 originator(OR)/ 全局白名单(双因子 AND)
/ 全局 app-server 开关 OR 账号 app-server 开关;均不命中 → 拒
- 版本门(仅官方候选):UA 须可解析引擎版本,再校验 [min,max] 区间
- 引擎指纹 AND 硬门:按信号列表逐条勾选 AND、每条行内变体 OR;无 Required 信号 → 放行
引擎指纹信号列表(唯一真源)
- 新增 openai.EngineFingerprintSignal 类型 + EvaluateEngineFingerprint 求值器
(勾选 AND / 行内变体 OR / 无勾选 → 放行)
- CodexRestrictionPolicy 增 EngineFingerprintSignals;信号列表单一决定是否启用指纹门,
不再保留独立「要求引擎指纹」总开关(与「信号全不选」语义重复)
- 新设置键 codex_cli_only_engine_fingerprint_signals(默认只勾 x-codex- 前缀);
旧 body 指纹开关幂等迁移并入信号列表;wire 接线
- 黑/白名单自由条目、命名预设、版本区间 全局设置管线
- gateway 缺 settingService(仅测试/误配可达)时指纹门回退默认种子信号、失败关闭,
不再因零值 policy(nil 信号)失败开放
账号级 Codex app-server(替换已失效的 ClaudeCode 放行机制)
- account.IsCodexCLIOnlyAppServerAllowed() 读 extra.codex_cli_only_allow_app_server,
仅在 codex_cli_only 开启时生效;候选身份门「全局 OR 账号」,与旧系统双层控制对齐
- 移除已无入口的 claude_code 预设机制(allowedClientRegistry / MatchAllowedClients /
账号 GetCodexCLIOnlyAllowedClients / reason);白名单 AllowedClientEntry / IsAllowedClientMatch 保留
门加固(反伪 + 写入校验)
- 官方 UA 访问门改 strict:IsCodexOfficialClientRequestStrict 仅前缀匹配,收窄「浏览器前缀 +
中段 codex token」伪造面(strict 仍保留 Codex 家族前缀与 UA 尾部兜底,故对「任意前缀 +
官方尾部 (name;ver)」仍放行——与 UA 可伪造、真正反伪靠引擎指纹门的设计一致)
- 官方客户端识别扩展:新增 codex-tui/、codex_vscode_copilot/ 前缀 + UA 尾部 (name;ver) 兜底
(恢复 CODEX_INTERNAL_ORIGINATOR_OVERRIDE 的真实 client,如 cccc→codex-tui),originator 改
精确集。该识别经 IsCodexOfficialClientByHeaders 被 passthrough 复用,故透传的官方判定一并
修正(codex-tui 等不再被误改写 UA)——非「行为不变」,属有意修正
- 白名单写入校验 ValidateCodexWhitelistEntriesJSON + AllowedClientEntry.IsWhitelistable:
双因子 AND 条目须可命中(非空 originator + 非空 ua_contains),拒绝写入会静默失效的死规则;
黑名单(OR 宽 deny,允许 originator-only)不受约束
管理端 / 前端
- handler / DTO / settings_view / 契约测试;gateway 接入判定链
- 信号列表编辑器(替换 body 开关)、api 类型、SettingsView;无勾选给常驻警告
- Create/Edit/Bulk 三弹窗「Codex Only」下新增 app-server 开关(OR 合并全局)
- 文案:UA/Originator → User-Agent/Originator;黑/白名单重命名为 User-Agent/Originator 黑/白名单;
「允许 App Server 第三方客户端」→「Codex app-server」+ 简介示例;i18n zh/en 同步
- 移除死代码 HasCodex*Fingerprint helper
测试:引擎指纹求值器 / 账号 app-server(OR 语义)/ detector(含 N1 strict、失败关闭)/
白名单写入校验 / BulkEdit spec 等;后端 build + service/openai/admin 单测全绿,前端 vue-tsc + vitest 全绿。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-26 16:19:41 +08:00
shaw
f93a6c50ce
fix: repair CI build & lint regressions on main
...
- openai_gateway_model_availability.go: pass platform through to
listSchedulableAccounts so OpenAI/Grok diagnosis scopes to the
correct candidate pool (build break introduced by Grok subscription
PR #3310 ).
- no_account_error.go: drop redundant context.Context type on
ctx := context.Background() to satisfy staticcheck ST1023.
2026-06-26 16:06:01 +08:00
Wesley Liddick
a8cfafa02c
Merge pull request #3489 from wucm667/fix/responses-anthropic-custom-tool-schema
...
fix(apicompat): Responses custom/freeform 工具转 Anthropic 时规范化 schema,修复 apply_patch 报错
2026-06-26 15:42:57 +08:00
Wesley Liddick
2fc4fef847
Merge pull request #3310 from heathermhuang/codex/grok-subscription-support
...
feat: add grok subscription support
2026-06-26 15:41:52 +08:00
shaw
fcd3bc1272
fix: return 404 model_not_found instead of 503 when no account supports the model
2026-06-26 15:38:06 +08:00
Heatherm Huang
44f502bab8
fix: address grok review feedback
2026-06-26 14:26:43 +08:00
wucm667
40c8252734
fix(apicompat): 规范化 custom 工具 schema
2026-06-26 14:08:03 +08:00
lyen1688
8a7269f539
fix: sanitize verbose OpenAI response failed events
2026-06-26 12:29:58 +08:00
Wesley Liddick
683a8d8096
Merge pull request #3421 from syx0310/fork/openai-codex-pat-auth-upstream
...
feat: add codex personal access token auth
2026-06-26 11:15:38 +08:00
Wesley Liddick
54ef446c1d
Merge pull request #3469 from wucm667/fix/responses-passthrough-duplicate-function-args
...
fix(openai): Responses passthrough 不再重复发出 function_call arguments,修复 Codex CLI 解析失败
2026-06-26 10:58:36 +08:00
Heatherm Huang
720db8983f
test: harden grok quota readiness
2026-06-26 10:42:21 +08:00
Heatherm Huang
8a87a658ad
test: cover grok readiness paths
2026-06-26 10:37:37 +08:00
Heatherm Huang
939905b8c7
fix: refine grok quota pause behavior
2026-06-26 10:37:37 +08:00
Heatherm Huang
0d28642181
feat: add grok quota probe parity
2026-06-26 10:37:37 +08:00
Heatherm Huang
1b9645ca32
fix: allow grok scheduler capability routing
2026-06-26 10:36:09 +08:00
Heatherm Huang
e7a4f3f465
test: fix grok oauth validation suite
2026-06-26 10:36:09 +08:00
Heatherm Huang
f29ccc7dfb
fix: reduce grok oauth account-risk paths
2026-06-26 10:36:09 +08:00
Heatherm Huang
b2e2c7e69c
fix: harden grok oauth gateway paths
2026-06-26 10:36:09 +08:00
Heatherm Huang
b3a07aeae7
fix: align grok oauth exchange with xai
2026-06-26 10:36:09 +08:00
Heatherm Huang
39be1ec97f
feat: add grok subscription support
2026-06-26 10:36:09 +08:00
Wesley Liddick
fd9c945fab
Merge pull request #3470 from wucm667/fix/order-currency-symbol-from-field
...
fix(admin): 订单金额币种符号读取 currency 字段,修复 USD 渠道显示为 ¥
2026-06-26 09:46:02 +08:00
Wesley Liddick
94c059c99e
Merge pull request #3471 from wucm667/fix/antigravity-standard-tier-empty-project-fallback
...
fix(antigravity): standard-tier 账号 project_id 为空时兜底,避免全部请求 500
2026-06-26 09:45:54 +08:00
Wesley Liddick
1721b2b2d1
Merge pull request #3404 from wucm667/fix/balance-preflight-prevent-overdraft
...
fix(billing): 余额扣减增加充足性校验,防止余额透支为负
2026-06-26 09:45:46 +08:00
Wesley Liddick
32ddd5c60b
Merge pull request #3405 from wucm667/fix/subscription-order-apply-recharge-multiplier
...
fix(payment): 订阅套餐订单应用 BALANCE_RECHARGE_MULTIPLIER 汇率换算
2026-06-26 09:45:38 +08:00
Wesley Liddick
d53dd112ce
Merge pull request #3442 from hsn8086/fix/openai-chat-transport-failover
...
fix(openai): fail over on chat completions transport errors
2026-06-26 09:43:00 +08:00
Wesley Liddick
36a352f5eb
Merge pull request #3429 from 404QAQ/fix/images-content-refusal-passthrough
...
fix(images): pass content-moderation refusals through as 400 instead of retrying
2026-06-26 09:42:50 +08:00
Wesley Liddick
9983f5b80a
Merge pull request #3428 from Milesians/codex/fix-subscription-plan-validity-unit
...
fix(payment): support plural subscription validity units
2026-06-26 09:42:42 +08:00
Wesley Liddick
6db9e42352
Merge pull request #3476 from zeyugao/main
...
Detect OpenAI overloaded errors by structured code
2026-06-26 09:42:22 +08:00
Wesley Liddick
fd0da2570d
Merge pull request #3481 from visa2/fix/gateway-glm-codex-tool-args-doubled
...
fix(apicompat): avoid doubling tool_call arguments from single-chunk upstreams (Codex + GLM)
2026-06-26 09:42:13 +08:00
Wesley Liddick
50c3e52799
Merge pull request #3460 from StarryKira/codex/fix-responses-cache-input
...
[codex] fix responses cache input for chat completions bridge
2026-06-26 09:42:04 +08:00
Wesley Liddick
db1813f7a3
Merge pull request #3434 from feitianbubu/fix/codex-cli-only-chat-completions
...
fix(gateway): enforce codex_cli_only restriction on /v1/chat/completions
2026-06-26 09:41:46 +08:00
Wesley Liddick
6d50934de6
Merge pull request #3457 from feitianbubu/fix/admin-usage-cache-breakdown
...
fix(admin/usage): populate cache creation/read token breakdown in stats
2026-06-26 09:41:36 +08:00
Wesley Liddick
27278f62ed
Merge pull request #3467 from jianjianai/fix/invalid-refresh-token-nonretryable
...
fix(token-refresh): treat refresh_token_invalidated as non-retryable / 添加 refresh_token_invalidated 到不可重试列表
2026-06-26 09:40:04 +08:00
Wesley Liddick
38355ed204
Merge pull request #3436 from feitianbubu/fix/email-identity-error-shadowing
...
fix(auth): stop swallowing email auth identity create error via shadowed err
2026-06-26 09:38:49 +08:00
shaw
c9f42e1f77
fix(lint): gofmt token_refresh_service.go after refresh_token_invalidated addition
2026-06-26 09:34:20 +08:00
visa2 and Claude Opus 4.8
29122e3051
fix(apicompat): avoid doubling tool_call arguments from single-chunk upstreams
...
When converting a Chat Completions stream into Responses events, the first
tool_call delta chunk was copied wholesale into stream state (including
function.arguments), then the same chunk's arguments were accumulated again by
the shared `+=` block. For OpenAI this is harmless because its first tool_call
chunk carries empty arguments, but upstreams that pack id+name+arguments into a
single chunk (e.g. GLM/Zhipu) end up with doubled arguments such as
{"cmd":"ls"}{"cmd":"ls"}. Codex then fails to parse the tool call with
"trailing characters", breaking every tool invocation.
Reset the copied arguments so the shared accumulator counts them exactly once,
keeping the emitted delta and the final done/arguments consistent.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-26 00:58:38 +08:00
Elsa
cc7612bdbd
Detect OpenAI overloaded error codes
2026-06-25 21:18:39 +08:00
DaydreamCoding and Claude Opus 4.8
0112782049
fix(gateway-openai): codex spark 剥离 image_generation 工具,修复 502
...
gpt-5.3-codex-spark 为 text-only,不支持 image_generation 工具;codex CLI 默认
在 /responses 的 tools[] 携带该工具,导致 ChatGPT 后端返回 400
invalid_request_error(param=tools),被 mapUpstreamError 兜底成 502
"Upstream request failed"(真实 400 见 ops_error_logs.upstream_errors)。
新增 stripCodexSparkImageGenerationTools,对 spark 剥离客户端携带的
image_generation 工具(tools 清空则删键),接入三条路径:
- applyCodexOAuthTransformWithOptions:OAuth 全入口(responses/messages/chat-completions)
- buildUpstreamRequestOpenAIPassthrough 无条件 spark 块:覆盖 OAuth+APIKey
/responses,不受 image-generation 开关影响
- WS stripCodexSparkImageGenerationToolFromRawPayload:覆盖 WebSocket /responses
bridge 注入(ensureOpenAIResponsesImageGenerationTool)本就跳过 spark;真正的缺口
在 normalizeOpenAIResponsesImageGenerationTools 会规范化并保留客户端工具。
临时绕过=换非 spark 模型;关 bridge/allow_image_generation 无效(工具是客户端带的)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-25 17:27:19 +08:00
wucm667
650c50e34b
fix(antigravity): add project fallback for standard tier
2026-06-25 16:29:33 +08:00
wucm667
55242ffac1
fix(admin): 订单金额币种符号读取 currency 字段
2026-06-25 16:23:45 +08:00
wucm667
2b49d662cc
fix(openai): dedupe passthrough function call args
2026-06-25 16:18:11 +08:00
简简aw
0a97a5f461
fix(token-refresh): treat refresh_token_invalidated as non-retryable
2026-06-25 15:12:21 +08:00
shaw
00d68ff6df
feat(openai): add GPT-5.5 codex instructions and use as latest fallback
2026-06-25 11:44:42 +08:00
haruka
dbdbfb1122
fix: avoid default codex instructions for chat bridge
2026-06-25 02:32:15 +08:00
feitianbubu
4567f6582b
test(admin/usage): update sqlmock rows for cache breakdown columns
2026-06-24 23:59:22 +08:00
feitianbubu
063454ae96
fix(admin/usage): populate cache creation/read token breakdown in stats
2026-06-24 23:43:03 +08:00
hsn
65fa728921
fix(openai): fail over on chat transport errors
2026-06-23 22:53:20 +08:00
feitianbubu
82576e0a38
fix(auth): stop swallowing email auth identity create error via shadowed err
2026-06-23 19:29:17 +08:00
feitianbubu
ae5e980dd1
fix(gateway): enforce codex_cli_only restriction on /v1/chat/completions
2026-06-23 18:38:52 +08:00
404QAQ
9491de0a39
fix(images): pass content-moderation refusals through as 400 instead of retrying
...
When gpt-image upstream returns response.completed with no image but a text
refusal (content moderation, e.g. the model replies "this request was judged
unsafe to generate"), the soft-failure path treated it as a probabilistic
upstream failure and returned a retryable UpstreamFailoverError (502). Retrying
or switching accounts is futile for a content-policy block — it just burns
other accounts' quota and still surfaces an opaque 502 to the client.
Distinguish the two no-image cases:
(A) model text refusal -> 400 content_policy_violation, no retry, refusal
reason passed through to the client.
(B) truly empty response -> unchanged: retryable UpstreamFailoverError (502).
Adds extractOpenAIImagesModelRefusal (extracts the refusal text from
output_text.delta / message output_text, capped at 600 chars) and two unit
tests; the existing empty-response retry test is unaffected.
2026-06-23 16:57:16 +08:00