Skip to content

Fix OpenAI OAuth image n fanout#2851

Open
SipengXie2024 wants to merge 2 commits into
Wei-Shaw:mainfrom
SipengXie2024:fix/openai-images-oauth-fanout
Open

Fix OpenAI OAuth image n fanout#2851
SipengXie2024 wants to merge 2 commits into
Wei-Shaw:mainfrom
SipengXie2024:fix/openai-images-oauth-fanout

Conversation

@SipengXie2024
Copy link
Copy Markdown

Summary

  • stop passing unsupported tools[0].n to the Responses image_generation tool
  • fan out non-streaming OAuth image requests with n > 1 into repeated n=1 upstream calls and aggregate the Images API data[]/usage response
  • reject streaming OAuth image requests with n > 1 explicitly because streaming fanout cannot preserve a standard stream contract

Tests

  • GOCACHE=/tmp/go-build-sub2api GOMODCACHE=/tmp/go-mod-sub2api go test ./internal/service -run 'TestOpenAIGatewayServiceForwardImages_OAuth(FanoutNAndReturnsAllImages|RejectsStreamingN|NonStreamModerationBlockedReturnsClientError)'
  • GOCACHE=/tmp/go-build-sub2api GOMODCACHE=/tmp/go-mod-sub2api go test ./internal/service currently fails on unrelated TestRunProxyQualityTarget_CloudflareChallenge

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

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:

I have read the CLA Document and I hereby sign the CLA

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.

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.

1 participant