[codex] fix Codex image generation transport#3383
Draft
cyeinfpro wants to merge 1 commit into
Draft
Conversation
Contributor
|
Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA). To sign, please reply with the following comment:
You only need to sign once — it will be valid for all your future contributions to this project. I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This PR routes OpenAI OAuth image generation/edit requests through ChatGPT's dedicated Codex images endpoints instead of the Responses API image tool path.
/backend-api/codex/images/generationsand/backend-api/codex/images/editsfor OAuth image accounts.size,quality,background,output_format,output_compression, andn.b64_jsonwhen requested by downstream clients.stream: truecallers.Why
The previous OAuth image path wrapped image requests inside the Responses API image-generation tool. That path did not reliably preserve native
gpt-image-2behavior, especially large output sizes such as3840x2160, and it made multi-imagenhandling depend on the Responses tool wrapper.The dedicated Codex images endpoint accepts the native image payload directly, so
gpt-image-22K/4K requests andnare passed to the upstream service without being translated into tool arguments.Validation
go test -tags unit ./internal/service -run 'TestOpenAIGatewayServiceForwardImages|TestOpenAIGatewayServiceParseOpenAIImagesRequest|TestBuildOpenAIImagesURL'gpt-image-24K generation returning3840x2160.