Skip to content

fix(create): replace retired gpt-image-1 in AI add-on image route - #589

Open
pcbeingused33 wants to merge 2 commits into
TanStack:mainfrom
pcbeingused33:fix/ai-image-model
Open

pcbeingused33 wants to merge 2 commits into
TanStack:mainfrom
pcbeingused33:fix/ai-image-model

Conversation

@pcbeingused33

@pcbeingused33 pcbeingused33 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the AI add-on's image demo, which still generates projects that call gpt-image-1.

OpenAI shut down gpt-image-1 on 2026-10-23 (https://developers.openai.com/api/docs/deprecations), with gpt-image-2.5-sunburst / gpt-image-2.5-flare as the listed replacements. The React AI add-on's /demo/api/ai/image route still passes openaiImage('gpt-image-1') and reports that model in its response, so a freshly scaffolded app fails on the first image request.

Fix: use gpt-image-2.5-flare (the model @tanstack/ai-openai uses in its openaiImage examples) in both places in api.ai.image.ts. It supports the same sizes the demo UI offers (1024x1024, 1536x1024, 1024x1536, auto), so nothing else changes. This follows the same approach as #543 and #562, plus a patch changeset.

Test: packages/create/tests/template-model-ids.test.ts now also checks that no framework template references gpt-image-1 (gpt-image-1-mini is unaffected). It fails on main (listing react/add-ons/ai/assets/src/routes/demo/api.ai.image.ts) and passes with this change. The @tanstack/create and @tanstack/cli unit suites pass.

This change was prepared with AI assistance.

Summary by CodeRabbit

  • Updates
    • AI image generation now uses gpt-image-2.5-flare instead of the retired gpt-image-1 model. Successful responses identify the model used; request handling and error responses remain unchanged.
  • Tests
    • Added a check to catch references to the retired model in framework templates, helping prevent outdated model identifiers from appearing in generated templates.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The AI image-generation route now uses gpt-image-2.5-flare and reports that identifier in successful responses. A template test checks for the retired gpt-image-1 identifier. A patch changeset records the update.

Changes: AI image model update

Layer / File(s) Summary
Update model and check templates
packages/create/src/frameworks/react/add-ons/ai/assets/src/routes/demo/api.ai.image.ts, packages/create/tests/template-model-ids.test.ts, .changeset/openai-image-current-model.md
The route selects and reports gpt-image-2.5-flare. The template test checks for gpt-image-1. The changeset documents the replacement.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: tannerlinsley

Merge Risk: Minimal · up to 75d2f

This updates the AI add-on's image route to a supported OpenAI image model after gpt-image-1 was retired. The adapter supports the new model and the demo's sizes, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the primary change: the AI add-on image route in packages/create now uses gpt-image-2.5-flare in place of the retired gpt-image-1 model. The changeset, the route file, and the template…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the primary change: the AI add-on image route in packages/create now uses gpt-image-2.5-flare in place of the retired gpt-image-1 model. The changeset, the route file, and the template model-ID test all match this. The title follows the conventional fix(scope) form, is specific, and omits no key part of the change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

ESLint analysis is incomplete because its dependency install exceeded the time available for this review.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 947b1766-5848-47ba-a8c3-76a8398c9b33
Commits

Reviewing files that changed from the base of the PR and between e5fffe9 and 75d2f85.

Files selected for processing: 1

  • packages/create/tests/template-model-ids.test.ts
Files skipped from review as they are similar to previous changes: 1

  • packages/create/tests/template-model-ids.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@changeset-bot

changeset-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 75d2f85

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@tanstack/create Patch
create-start-app Patch
create-tanstack-app Patch
create-tanstack Patch
create-tsrouter-app Patch
@tanstack/create-start Patch
@tanstack/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tannerlinsley

Copy link
Copy Markdown
Member

Thanks for fixing this! The replacement works with the published adapter. I also removed the outdated note about the mini model from the test comment.

AI review notes:
Reviewed the full three-file change at e5fffe9 and the comment-only follow-up 75d2f85. No dependency, hook or workflow changes. OpenAI lists gpt-image-2.5-flare as a replacement for the retired gpt-image-1, and the downloaded @tanstack/ai-openai 1.2.1 supports this model and the demo’s image sizes.
Independent isolated checks passed: all 10 builds, both normal unit targets including lint (571 tests), and 22 blocking browser tests. The retired-model regression also fails under the negative control and passes on the candidate. The follow-up only corrects a comment, so this executable validation still applies.
Generated an npm React AI app outside the monorepo using the built CLI. Dependency installation, production build and TypeScript checks pass. Local page GET returns 200, an empty prompt returns 400, and a valid prompt without an API key returns the expected 500 configuration error. No provider request was made, successful image generation against OpenAI was not tested.
The changed route template grows from 1,870 to 1,886 bytes, gzip 575 to 582 bytes. This measures the template only, not the entire CLI artifact. No applicable size budget exception is needed.
The current head still needs its normal hosted checks. Neither source path changes a Core-owned file, and this has not been merged or released.

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