Skip to content

fix: preserve GPT Image 2 auto failover defaults - #41

Merged
lingozhi merged 9 commits into
mainfrom
codex/gpt-image-2-auto-failover-defaults
Aug 2, 2026
Merged

fix: preserve GPT Image 2 auto failover defaults#41
lingozhi merged 9 commits into
mainfrom
codex/gpt-image-2-auto-failover-defaults

Conversation

@lingozhi

@lingozhi lingozhi commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve the documented GPT Image 2 size=auto tuple as a contract wildcard
  • keep its resolved defaults compatible with the unchanged KIE backup profile
  • retain the strict 36-tuple fixed-size matrix and the existing 1K/auto/auto compatibility path
  • keep the exception limited to gpt-image-2 generation-only production-verified profiles

Production bug

The full matrix profile encoded auto as 1K/auto/auto, while channel 127 intentionally retains generation,size=auto. Candidate default consistency runs before priority selection, so a caller that sends only size=auto receives must specify resolution instead of selecting Opwan and preserving KIE failover.

Verification

  • RED: DTO validation rejected the contract wildcard and channel selection chose 127 instead of primary 117
  • GREEN: focused DTO + channel selection regression tests pass
  • go test ./dto ./model -count=1
  • go test ./... -count=1

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃挕 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".

Comment thread dto/image_routing.go Outdated
Comment on lines +675 to +676
((combination.Resolution == "1K" && combination.AspectRatio == "auto") ||
(combination.Resolution == "" && combination.AspectRatio == ""))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 馃憤聽/ 馃憥.

@lingozhi
lingozhi merged commit a08c64c into main Aug 2, 2026
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