Commit Graph
17 Commits
Author SHA1 Message Date
Liu LinhuaiandClaude Opus 4.8 381d1d6d6c fix(images): surface real upstream error instead of generic 502
The /v1/images/generations and /v1/images/edits paths routed every
non-failover upstream error through the generic handleErrorResponse,
whose final switch collapses anything that isn't 401/402/403/429 into a
hardcoded 502 "Upstream request failed" — discarding the actual upstream
status code, type, code, message, and param. So a gpt-image-2 400
(invalid_request_error, moderation, unsupported parameter, ...) reached
the client as an opaque 502.

The sibling Chat Completions and Messages compat paths already avoid this
via handleCompatErrorResponse, which preserves the real status and
message. Add the equivalent for images: handleOpenAIImagesErrorResponse
keeps all existing side-effects (ops logging, error-passthrough rules,
ShouldHandleErrorCode, account-disable/secondary-failover) but surfaces
the real upstream status + type/code/message/param by reusing the
existing OpenAIImagesUpstreamError machinery. Both forward paths now call
it instead of handleErrorResponse for non-failover errors.

Failover behavior (5xx / 401 / 403 / 429 / 529) is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 17:23:13 +08:00
name 34de99ee0e refactor(gateway): cap upstream error body reads 2026-05-30 20:01:40 +08:00
shaw ed1b57c597 fix(openai): gate routing by endpoint capability 2026-05-29 08:58:10 +08:00
mt21625457 33ac8eb27d fix openai http2 response header timeout 2026-05-26 13:57:59 +08:00
gaoren002 888cd8092d fix(openai): surface image moderation errors 2026-05-20 09:19:20 +00:00
wucm667 2c14efeaa0 fix(openai-images): 修复图片生成 n 参数透传 2026-05-20 11:28:28 +08:00
Wesley Liddick 36e461e7c9 Merge pull request #2424 from wucm667/fix/openai-versioned-base-url
fix(openai): handle versioned compatible base URLs
2026-05-19 14:44:37 +08:00
wucm667 679c0865a0 fix(openai): handle versioned compatible base URLs 2026-05-13 11:25:15 +08:00
2ue bb4c1abe28 Fix image billing size normalization 2026-05-12 15:21:31 +08:00
shaw fff4a300c6 feat(risk-control): add content moderation audit 2026-05-07 09:14:47 +08:00
2ue 6faa344916 feat: add OpenAI image generation controls 2026-05-05 03:26:54 +08:00
shaw b2bdba78dd stabilize image request handling 2026-05-03 14:56:09 +08:00
VitalyR ca5d029e7c fix(openai): honor versioned image base URLs 2026-04-28 04:53:29 +08:00
wx-11 9e5a6351fc 修复计费问题以及模型回显 2026-04-23 15:09:47 +08:00
wx-11 eea6f38881 使用codex的生图接口代替web2api 2026-04-23 12:44:44 +08:00
meteor041 00778dca31 fix openai image request handling 2026-04-23 09:53:57 +08:00
lucas morgan c548021921 feat(openai): 同步生图 API 支持并接入图片计费调度
- 同步 OpenAI 图片生成与编辑接口
- 接入图片请求解析、账号调度、转发与用量记录
- 接入图片计费与图片用量落库
- 限制 OAuth 生图仅支持无显式模型和尺寸的基础请求
2026-04-22 12:30:08 +08:00