Repository navigation
fix(images): forward background and shrink large references on the Codex hosted image path - #15941
Merged
diegosouzapw merged 3 commits intoOct 10, 2026
Conversation
…dex hosted image path
The handler test file is frozen at 2235 lines. The new background and shrink cases now live in their own file. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
diegosouzapw
merged commit Oct 10, 2026
af6bcb7
into
cheaper-inference:release/v3.8.52
19 of 41 checks passed
Collaborator
|
Thanks @HDBR — Codex hosted image generation forwards background and shrinks reference images larger than 400 KB. This is in the upcoming release. |
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.
Summary
Two small fixes on the Codex hosted
image_generationpath (thegpt-5.6-*-imagecatalog entries that #14976 deliberately left on the Responses tool):backgroundis now forwarded to the tool. The hosted tool acceptsbackground("transparent","opaque","auto"), but the handler only copiedsizeandquality, so a logo or sticker request withbackground: "transparent"always came back on an opaque canvas. The dedicated Images API path (fix(providers): route Codex GPT Image models to dedicated Images API #14976) already forwards it; this aligns the hosted path./v1/images/editsthe backend answers 503 when an inline reference is large (we saw it consistently above ~400 KB, from a self-hosted instance in production use). References above 400 KB are now resized to a 1024 px long edge with the existing optional-sharp helper (normalizeImageBuffer); smaller references, and platforms where sharp fails to load, pass through unchanged.Changes
open-sse/handlers/imageGeneration.ts:toolConfig.backgroundfrombody.background(trimmed, ignored when blank); new exportedshrinkCodexReferenceImage()used for each reference image.tests/unit/image-generation-handler.test.ts: one test forbackgroundforwarding (set and blank), one forshrinkCodexReferenceImage(small passthrough; a >400 KB PNG shrinks to a ≤1024 px long edge and keeps its mime).changelog.d/fixes/: fragment.Tests
Injected defect: with the previous handler and the new tests, the two new tests fail (50 pass, 2 fail).
Prettier: clean. ESLint on the two touched files: the same 6 pre-existing findings as the base, none on changed lines.