Wesley Liddick
42d1bf298d
Merge pull request #4306 from wp-a/fix/openai-passthrough-error-sanitization
...
fix(openai): sanitize passthrough upstream errors
2026-07-15 10:11:41 +08:00
shaw
eb7933af4c
fix(openai): 移除 #4269 合并时复活的旧版 Grok 错误路径处理
...
#4269 分支基于 #4212 之前的 main(merge-base da85cc7e),合并后把
ForwardAsAnthropic 错误路径上已被 #4212 重构移除的 Grok 块带了回来:
- xai.ParseQuotaHeaders 的 import 已被 main 删除,导致 main 编译失败;
- 该块与 failoverOpenAIUpstreamHTTPError 内部的 handleGrokAccountUpstreamError
重复(后者第一步就用新解析器 parseGrokQuotaSnapshot 更新配额快照),
保留会造成 Grok 错误双重处置。
删除整块,恢复 #4212 语义;#4269 的 agent identity 恢复逻辑保留不动。
2026-07-15 10:01:31 +08:00
Wesley Liddick
4355861ef2
Merge pull request #4269 from catoncat/agent/sub2api-agent-identity
...
feat(openai): support Codex Agent Identity authentication
2026-07-15 09:47:00 +08:00
Wesley Liddick
30df3f68e4
Merge pull request #4264 from lyon-le/perf/content-moderation-keyword-hot-path
...
perf(risk): 优化内容审核关键词热路径(优化性能)
2026-07-15 09:39:33 +08:00
Wesley Liddick
1c61225b28
Merge pull request #4271 from jianjianai/codex/perf-u10-ops-projection
...
优化 Ops 队列深度账号查询
2026-07-15 09:39:09 +08:00
Wesley Liddick
7cb8ece8d3
Merge pull request #4274 from jianjianai/codex/perf-u16-content-seed-scan
...
优化内容会话种子字段扫描
2026-07-15 09:38:59 +08:00
Wesley Liddick
8d13bbbea5
Merge pull request #4284 from zh239ns/codex/fix-openai-oauth-image-actual-size
...
fix(images): report decoded OAuth output dimensions
2026-07-15 09:37:34 +08:00
Wesley Liddick
125b03aee6
Merge pull request #4281 from bestony/feat/openai-ws-proxy-failed-host
...
fix(openai): include proxy host in websocket_proxy_failed logs
2026-07-15 09:37:04 +08:00
Wesley Liddick
65093591cd
Merge pull request #4282 from bestony/feat/openai-failover-switching-proxy-host
...
fix(openai): include proxy host in upstream_failover_switching logs
2026-07-15 09:36:53 +08:00
Wesley Liddick
1f91b69ca6
Merge pull request #4288 from wucm667/fix/issue-4285-gpt56-account-cost
...
fix: 修复 GPT-5.6 长上下文账号成本统计
2026-07-15 09:36:43 +08:00
shaw
a0593b0bf8
fix(gateway): 客户端断开后 failover 静默终止,不再误报 502 账号耗尽
...
上游请求经 detachUpstreamContext(WithoutCancel) 有意脱离客户端取消(保
计费),但 failover 循环仍用原始 c.Request.Context() 重新选号:客户端
断开后上游返回 520 等可 failover 错误时,重新选号必然得到 context
canceled,被误判为账号耗尽,记录并返回通用 502。
修复:客户端已断开 ⇒ failover 静默终止。
- 新增 failoverClientGone(c):请求 ctx 已取消时先停 compact 心跳
(建立 happens-before,对齐其它终结路径),响应未提交则标 499
(statusClientClosedRequest,与并发槽取消路径同惯例)
- 7 个 OpenAI 内联 failover 循环(Responses/Messages/chat_completions/
embeddings/images/grok_media/alpha_search)加双 guard:换号前 +
选号失败分支入口;guard 位于 ReportOpenAIAccountScheduleResult(false)
之后、RecordOpenAIAccountSwitch/池模式重试之前,账号健康副作用
(service 层 detached ctx)不受影响
- FailoverState.HandleFailoverError/HandleSelectionExhausted 入口加
ctx.Err() 检查返回 FailoverCanceled,取消不再改动 failover 状态;
全部 10 个 FailoverCanceled 分支统一调用 failoverClientGone 归类 499
- 上游 detach 与计费设计不变;真实上游 520 事件仍完整落 ops
(面板显示码 COALESCE(upstream_status_code,status_code)=520,
错误率/告警口径不变)
测试:新增 openai_responses_failover_cancel_test.go 复现 issue 场景
(520+取消 ⇒ 不切号、499、无 502 终态)+ 在线客户端对照(正常切换、
耗尽 502);failover_loop_test.go 补入口取消用例并修正取消语义断言。
Fixes #4257
2026-07-15 09:29:05 +08:00
Wesley Liddick
accb918eca
Merge pull request #4212 from heathermhuang/codex/fix-grok-oauth-credential-failover
...
fix(grok): fail over OAuth credential errors safely
2026-07-15 08:37:17 +08:00
王鹏
536865032c
fix(openai): sanitize passthrough upstream errors
2026-07-15 04:47:16 +08:00
wucm667
25e6688af6
[verified] fix: apply long-context pricing to account cost
2026-07-14 22:31:39 +08:00
zh239ns
bef520b191
fix(images): report decoded OAuth output dimensions
...
ChatGPT OAuth may normalize explicit image size controls to auto while returning smaller raster bytes. Decode final image headers so Images API metadata and tier billing reflect the actual output for both streaming and non-streaming OAuth responses.
2026-07-14 20:31:17 +08:00
bestony
ba5b6970be
fix(openai): include proxy host in upstream_failover_switching logs
...
Enrich openai.upstream_failover_switching structured logs with proxy
identity fields (proxy_id, proxy_name, proxy_host, proxy_port) so
operators can see which outbound proxy failed when switching accounts.
Matches the existing gateway.forward_failed / websocket_proxy_failed
logging pattern.
2026-07-14 19:33:56 +08:00
bestony
b000aac474
fix(openai): include proxy host in websocket_proxy_failed logs
...
Add proxy_id/proxy_name/proxy_host/proxy_port fields to openai.websocket_proxy_failed so operators can identify which proxy failed without extra lookups. Matches the existing gateway.forward_failed logging pattern.
2026-07-14 19:32:49 +08:00
cat
ec7c1b6f72
fix(openai): 修复 Agent Identity CI 问题
2026-07-14 19:24:56 +08:00
cat
d68a2aac1a
chore(openai): 同步上游并解决认证冲突
2026-07-14 19:04:04 +08:00
cat
f479a5d10c
fix(openai): 收紧 Agent Identity task 生命周期
2026-07-14 18:09:59 +08:00
cat
bd1399f81e
fix(openai): 允许 Agent Identity 无令牌拨号 WS
2026-07-14 17:41:17 +08:00
Lyonle
8b37ba8828
perf(risk): optimize keyword moderation hot path
2026-07-14 17:39:49 +08:00
cat
10aa88aab9
fix(openai): 补齐身份失效恢复路径
2026-07-14 17:19:15 +08:00
cat
3fe7b4da78
fix(openai): 闭合直通 WS 恢复与错误脱敏
2026-07-14 17:05:47 +08:00
cat
57cf2df09f
fix(openai): 收紧 Agent Identity 恢复与脱敏
2026-07-14 17:05:47 +08:00
cat
1dab126944
feat(openai): 支持 Agent Identity 认证
2026-07-14 17:05:46 +08:00
jjaw
86800a8cd0
优化内容会话种子字段扫描
2026-07-14 16:53:21 +08:00
jjaw
a8afc20969
优化 Ops 队列深度账号查询
2026-07-14 16:18:26 +08:00
github-actions[bot]
7c717365ef
chore: sync VERSION to 0.1.155 [skip ci]
2026-07-14 07:08:08 +00:00
Heatherm Huang
4c764d3fc9
test(grok): use healthy quota account fixture
2026-07-14 15:07:09 +08:00
Heatherm Huang
cb7dfea5a9
test(grok): update default model fixture
2026-07-14 14:55:30 +08:00
Heatherm Huang
81b8b78378
fix(grok): resolve upstream OAuth imports
2026-07-14 14:55:30 +08:00
Heatherm Huang
b32b815e46
fix(grok): harden OAuth pool recovery
2026-07-14 14:55:30 +08:00
Heatherm Huang
91ae671a58
fix(grok): satisfy lint checks
2026-07-14 14:55:30 +08:00
Heatherm Huang
343390057d
fix(grok): fail over OAuth credential errors safely
2026-07-14 14:55:30 +08:00
shaw
fa1641f05f
fix: keep namespace verbatim on WSv2 forwards and check test type assertions
...
WSv2 egress relays upstream events verbatim without the HTTP-path
namespace restore, so flattening requests that take the WSv2 branch
would surface flattened tool names the client cannot match. Resolve
the WS transport decision before flattening and skip flattening only
when the request will actually go WSv2 (passthrough accounts return
via HTTP before the WSv2 branch and still flatten).
Also check all type assertions in responses_namespace_test.go to
satisfy golangci-lint errcheck.
2026-07-14 14:48:22 +08:00
shaw
252ef8b73a
Merge origin/main into codex/fix-native-responses-namespace
...
Resolve conflict in openai_gateway_passthrough.go streaming path: keep
main's normalizeCompletedImageGenerationStatus normalization ahead of
this branch's namespace restore block, mirroring the established order
in openai_gateway_response_handling.go.
2026-07-14 14:45:04 +08:00
Wesley Liddick
53004e2e90
Merge pull request #4238 from superman2003/feat/grok-monitor-auto-probe
...
feat(grok): add import probes and channel monitoring
2026-07-14 14:23:04 +08:00
Wesley Liddick
11ed22d052
Merge pull request #4240 from chensunlai/fix/openai-responses-lite-image-display
...
fix(openai): preserve client image tools in Responses Lite
2026-07-14 14:22:50 +08:00
li
2e9b8d9a64
fix: resolve golangci-lint errcheck and gofmt violations in reasoning test
...
Use two-value type assertions with require.True(t, ok) to satisfy
errcheck, and run gofmt to fix alignment.
2026-07-14 13:23:57 +08:00
chensunlai
2f715baf05
fix(openai): preserve client image tools in Responses Lite
2026-07-14 05:19:13 +00:00
li
ff639ba757
fix(grok): 清洗 reasoning 项中 content: null 避免 xAI 422
...
Fixes #4237
2026-07-14 13:13:32 +08:00
superman2003
16d1fbfd4e
fix(ci): keep probe scheduler snapshots test-only
2026-07-14 12:45:03 +08:00
superman2003
0a64a6d8ce
feat(monitor): support Grok channel health checks
2026-07-14 12:24:42 +08:00
superman2003
d8a07e91a5
fix(grok): stabilize prompt cache routing identity
2026-07-14 12:24:42 +08:00
superman2003
a1b5c75ca3
feat(grok): probe newly imported OAuth accounts
2026-07-14 12:24:42 +08:00
Wesley Liddick
69bc6a87dd
Merge pull request #4231 from superman2003/fix/grok-free-rolling-24h-20260714
...
fix(grok): use rolling 24h free quota estimate
2026-07-14 11:31:48 +08:00
Wesley Liddick
c361b0606d
Merge pull request #4219 from zh239ns/codex/fix-openai-images-nonstream-keepalive
...
fix(images): add opt-in non-stream JSON keepalive
2026-07-14 11:30:28 +08:00
shaw
ac7a141a24
fix(images): align OAuth pre-response size snapshot with keepalive-adjusted metric
...
The snapshot taken before dispatching the OAuth response handler still used
raw c.Writer.Size(), while handleOpenAIImagesOAuthResponseError compares it
against the keepalive-adjusted size. From the second failover round on, the
previous round's heartbeat bytes made the raw snapshot positive while the
adjusted size stayed -1, so a retryable upstream error was misjudged as
'response already written': the failover was swallowed and the client got a
committed 200 with a whitespace-only body.
Snapshot now uses OpenAIImagesJSONKeepaliveAdjustedWrittenSize, matching the
comparison side. Regression test simulates a prior-round heartbeat before
ForwardImages and asserts the retryable error still converts to
UpstreamFailoverError (verified red without the fix, green with it).
2026-07-14 11:24:44 +08:00
Wesley Liddick
527279c953
Merge pull request #4225 from BenjaminAaron196/fix/reset-credit-count-fallback
...
fix(openai): 提升主动重置次数识别的可靠性
2026-07-14 11:11:54 +08:00