fix: preserve GPT Image 2 auto failover defaults - #41
Conversation
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53e68ef5e4
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ((combination.Resolution == "1K" && combination.AspectRatio == "auto") || | ||
| (combination.Resolution == "" && combination.AspectRatio == "")) |
There was a problem hiding this comment.
Prevent the auto tuple from wildcarding explicit geometry
When this newly permitted tuple is combined with the fixed GPT Image 2 matrix, an explicit unsupported request such as resolution=4K, aspect_ratio=3:2 matches {generation, size:auto} because ImageRoutingCombination.matches treats its empty resolution and aspect ratio as wildcards. ApplyDefaults then resolves the request to size=auto, so Supports accepts it despite the matrix lacking that tuple; the images_generations path strips the geometry aliases and sends only size=auto, while billing retains the requested 4K resolution. Thus users can be charged for 4K while receiving the provider's automatic geometry. The exception must apply only when geometry was not explicitly requested, rather than admitting a generally matching combination.
AGENTS.md reference: AGENTS.md:L119-L119
Useful? React with 馃憤聽/ 馃憥.
Summary
size=autotuple as a contract wildcard1K/auto/autocompatibility pathgpt-image-2generation-only production-verified profilesProduction bug
The full matrix profile encoded auto as
1K/auto/auto, while channel 127 intentionally retainsgeneration,size=auto. Candidate default consistency runs before priority selection, so a caller that sends onlysize=autoreceivesmust specify resolutioninstead of selecting Opwan and preserving KIE failover.Verification
go test ./dto ./model -count=1go test ./... -count=1