Skip to content

fix: 正确代理 OpenAI 图片生成与编辑请求 - #140

Merged
lich0821 merged 2 commits into
lich0821:masterfrom
kokojacket:fix/openai-images-routing
Jul 28, 2026
Merged

fix: 正确代理 OpenAI 图片生成与编辑请求#140
lich0821 merged 2 commits into
lich0821:masterfrom
kokojacket:fix/openai-images-routing

Conversation

@kokojacket

@kokojacket kokojacket commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

修改内容

  • 识别 OpenAI 图片生成和图片编辑路由,避免将其误判为 Claude 请求
  • 在完整端点请求链中保留原始图片模型和请求体,不再套用文本模型覆盖
  • 当上游基础地址已经以 /v1 结尾时,避免生成重复的 /v1/v1 路径
  • 增加回归测试,覆盖 openai、openai2、图片生成、图片编辑及带 /v1 的上游地址

问题原因

发送到 /v1/images/generations 和 /v1/images/edits 的请求此前会进入默认 Claude 请求格式,随后被 ccNexus 改写到 /v1/responses,导致上游返回以下错误:

model gpt-image-2 is only supported on /v1/images/generations and /v1/images/edits

测试

  • go test ./... -count=1
  • 本地完成 macOS arm64 构建
  • 使用重新构建的 ccNexus.app 成功完成实际生图请求

@kokojacket kokojacket changed the title fix: route OpenAI image requests to the Images API fix: 正确代理 OpenAI 图片生成与编辑请求 Jul 26, 2026
@kokojacket kokojacket closed this Jul 26, 2026
@kokojacket
kokojacket deleted the fix/openai-images-routing branch July 26, 2026 09:00
@lich0821

Copy link
Copy Markdown
Owner

咋关闭了?

@kokojacket

Copy link
Copy Markdown
Contributor Author

AI 把我的分支删了,hhhh,然后就自动关闭了

@kokojacket
kokojacket restored the fix/openai-images-routing branch July 28, 2026 00:48
@kokojacket kokojacket reopened this Jul 28, 2026
@lich0821
lich0821 merged commit 097bb55 into lich0821:master Jul 28, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants