[v6.0] fix: new OpenAI model versions falling back to incompatible legacy request defaults - #17828
Merged
Conversation
…quest defaults (#17820) ## Background Recognizable newer OpenAI language and image model IDs inherited legacy defaults, causing invalid reasoning requests, stripped service tiers, and incorrect GPT Image parameters in OpenAI and shared Azure model implementations. ## Root Cause OpenAI capability and image defaults relied on hardcoded model allowlists rather than family/version recognition. Reproduction and request-level tests confirmed that current o4 and hypothetical future family IDs were misclassified while fine-tuned, proxy, and custom IDs correctly required conservative fallbacks. ## Summary Added anchored o-series and GPT version parsing for reasoning, parameter, and service-tier capabilities; family-wide GPT Image response-format and image-count defaults; conservative unknown-ID behavior; regression fixtures and tests; and a patch changeset for @ai-sdk/openai. ## Testing Capability matrices and request-level Chat, Responses, and image tests cover current and hypothetical versions, multi-digit versions, service tiers, fine-tuned/proxy IDs, and unknown IDs. Focused Node and Edge runs each passed all 148 tests; the package build, targeted checks, and full type-check also passed. ## End-to-end Validation - `pnpm -C examples/ai-functions exec tsx -e …` exercised live gpt-5.6 Chat and Responses requests; both returned `ok` with `stop`. - `pnpm -C examples/ai-functions exec tsx -e …` exercised live gpt-image-2 generation; it returned one PNG image. ## Related Issues Fixes #17799 Closes #17817 Co-authored-by: gr2m <39992+gr2m@users.noreply.github.com> --------- Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
gr2m
approved these changes
Jul 23, 2026
gr2m
enabled auto-merge (squash)
July 23, 2026 05:18
Contributor
|
🚀 Published in:
|
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.
Background
Recognizable newer OpenAI language and image model IDs inherited legacy defaults, causing invalid reasoning requests, stripped service tiers, and incorrect GPT Image parameters in OpenAI and shared Azure model implementations.
Root Cause
OpenAI capability and image defaults relied on hardcoded model allowlists rather than family/version recognition. Reproduction and request-level tests confirmed that current o4 and hypothetical future family IDs were misclassified while fine-tuned, proxy, and custom IDs correctly required conservative fallbacks.
Summary
Added anchored o-series and GPT version parsing for reasoning, parameter, and service-tier capabilities; family-wide GPT Image response-format and image-count defaults; conservative unknown-ID behavior; regression fixtures and tests; and a patch changeset for @ai-sdk/openai.
Testing
Capability matrices and request-level Chat, Responses, and image tests cover current and hypothetical versions, multi-digit versions, service tiers, fine-tuned/proxy IDs, and unknown IDs. Focused Node and Edge runs each passed all 148 tests; the package build, targeted checks, and full type-check also passed.
End-to-end Validation
pnpm -C examples/ai-functions exec tsx -e …exercised live gpt-5.6 Chat and Responses requests; both returnedokwithstop.pnpm -C examples/ai-functions exec tsx -e …exercised live gpt-image-2 generation; it returned one PNG image.Related Issues
Fixes #17799
Closes #17817
Backport of #17820
Co-authored-by: gr2m 39992+gr2m@users.noreply.github.com