Skip to content

feat(codex): add gpt-image-2.5, flare, and sunburst image models support - #3943

Closed
yheiakadylan wants to merge 1 commit into
decolua:masterfrom
yheiakadylan:feat/codex-image-models-2.5
Closed

yheiakadylan wants to merge 1 commit into
decolua:masterfrom
yheiakadylan:feat/codex-image-models-2.5

Conversation

@yheiakadylan

Copy link
Copy Markdown
Contributor

No description provided.

@yheiakadylan

Copy link
Copy Markdown
Contributor Author

Summary

This PR adds official support for OpenAI Codex's latest image generation models (gpt-image-2.5, gpt-image-2.5-flare, and gpt-image-2.5-sunburst), as well as complementary image tool models (gpt-image-2, gpt-image-1.5).

It also updates the Codex image provider handler to properly route tool-based image models through ChatGPT's Responses API while maintaining full backward compatibility with legacy -image suffixed models.


Background & Problem

OpenAI rolled out new image generation models for ChatGPT/Codex subscribers under the gpt-image-2.5 family (gpt-image-2.5, gpt-image-2.5-flare, and gpt-image-2.5-sunburst).

Unlike legacy models which simply strip the -image suffix to target a chat model (e.g., gpt-5.5-image → gpt-5.5), tool-based image models:

  1. Require the top-level Responses API model parameter to be set to a supported host model (gpt-5.5).
  2. Require the image_generation tool definition to explicitly pass the target model (imgTool.model = toolModel) and action (generate or edit depending on image inputs).
  3. Require explicit tool_choice and reasoning settings to ensure the Responses API triggers the image generation tool properly.

Changes

1. Codex Image Provider Handler (open-sse/handlers/imageProviders/codex.js)

  • Introduced CODEX_TOOL_IMAGE_MODELS set containing gpt-image-1.5, gpt-image-2, gpt-image-2.5, gpt-image-2.5-flare, and gpt-image-2.5-sunburst.
  • Implemented resolveCodexImageModels() to differentiate between:
    • Tool models: mapped to host gpt-5.5 with imgTool.model = toolModel and imgTool.action = (refs.length > 0 ? "edit" : "generate").
    • Suffix models: cleanly stripped (e.g., gpt-5.5-image → gpt-5.5) without breaking existing workflows.
  • Configured tool_choice: { type: "image_generation" } and reasoning effort for tool models so prompts consistently trigger image generation.

2. Provider Registries

  • open-sse/providers/registry/codex.js:
    • Registered gpt-image-2.5, gpt-image-2.5-flare, gpt-image-2.5-sunburst, gpt-image-2, and gpt-image-1.5 with capabilities: ["text2img", "edit", "multiImage"].
  • open-sse/providers/registry/openai.js:
    • Added corresponding gpt-image-2.5, gpt-image-2.5-flare, and gpt-image-2.5-sunburst entries under the OpenAI provider registry for consistency.

3. Unit Tests (tests/unit/image-generation.test.js)

  • Added comprehensive unit test covering Codex image generation using gpt-image-2.5 tool model to verify:
    • Responses API endpoint and headers.
    • Host model resolution (gpt-5.5).
    • Correct tool payload ({ type: "image_generation", model: "gpt-image-2.5", action: "generate" }).
    • Correct tool_choice and reasoning configuration.

Verification & Testing

  • Syntax validation checked via node --check.
  • Unit test passing for gpt-image-2.5 tool call payload formatting.
  • Verified that existing models (gpt-5.5-image, gpt-5.6-sol-image, etc.) remain unaffected.
  • Clean commit history branching directly off upstream/master without extraneous repository modifications.

@decolua

decolua commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Thanks @yheiakadylan for the contribution! Reviewed and merged into master. 🙏

@decolua decolua closed this Sep 10, 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.

2 participants