@ai-sdk/openai 4.0.99 declares promptCacheOptions with a different type on OpenAILanguageModelResponsesOptions and OpenAIResponsesProviderOptions. The changelog for the same release adds support for 12h prompt cache writes and cache prewarming. Code that supplies or reads that member through either type may stop type-checking after the upgrade.
What changed
OpenAILanguageModelResponsesOptions. Version 4.0.99 declarespromptCacheOptionswith another type than 4.0.98 did. The finding is breaking, with medium confidence, and it is reported wherever the type is imported from@ai-sdk/openaiand named in a type position.OpenAIResponsesProviderOptions. This carries the same change. In the exported declarations it is an alias ofOpenAILanguageModelResponsesOptions, so one options object in your code can produce both reports and one correction can settle both.- What a report means. Naming either type does not mean the changed member reaches that code. A file that only passes options along, without setting or reading
promptCacheOptions, may need no edit.
Before and after
Neither finding has a deterministic rewrite, so there is no fixed before and after pair for this release. The scan reports any type position that names either type imported from the package:
import type { OpenAIResponsesProviderOptions } from '@ai-sdk/openai';The declaration of the underlying type reads the same in 4.0.98 and 4.0.99:
type OpenAILanguageModelResponsesOptions = InferSchema<typeof openaiLanguageModelResponsesOptionsSchema>;What differs is the schema behind that line, where promptCacheOptions has another type. Open dist/index.d.ts in the installed 4.0.99 package to read the new member type, then bring the code that sets or reads it into line with that declaration and leave the rest of the file alone.
Migration guidance and its limits
Both findings carry assisted patches. emendant fix writes one only when you name a model provider, on the command line or in your Emendant configuration. Without a provider, each finding is reported with its guidance and nothing is changed. Nothing in this release is report only. Run emendant scan first to see which files are named, then emendant fix for the patches.
Each patch is checked with your typecheck and your tests. Read the patch header to see which checks passed, and review every edit that touches promptCacheOptions. Whether to adopt the new prompt cache behaviour is your decision, and a patch does not make it for you.
A report on a file that never sets or reads promptCacheOptions may need no edit, and a patch may not be available for it. Review the surrounding code before you accept a change there.
A clean scan does not cover these types reached through your own re-export, or a same-named type imported from another module. Those are not reported. This page covers the two changes the feed carries for 4.0.99 and nothing else in the release.
What Emendant detects, fixes and verifies
2 changes in @ai-sdk/openai 4.0.99. 0 automatic fixes, 2 fixes requiring a model provider you choose, 0 report only. Each patch states which checks passed. Understand patch evidence.
| Change | Severity | Detects | Fix | Verified by |
|---|---|---|---|---|
Changed the members of OpenAILanguageModelResponsesOptionsai-sdk-openai-npm-4.0.99-open-ailanguage-model-responses-options-members-changed | Breaking medium confidence |
| Patch, only when you name a model provider | Your typecheck and tests |
Changed the members of OpenAIResponsesProviderOptionsai-sdk-openai-npm-4.0.99-open-airesponses-provider-options-members-changed | Breaking medium confidence |
| Patch, only when you name a model provider | Your typecheck and tests |
emendant explain <change-id> prints any row's entry, guidance and sources at the terminal.
Coverage
Requires emendant@0.3.0 or later. Run emendant feed update to get the latest coverage.
Coverage details
- Snapshot
2026-10-21.1, sequence 51, signed 21 October 2026- Feed entry
feed/npm/@ai-sdk/openai/4.0.99.json
emendant feed status shows the snapshot your machine holds.
Primary sources
- @ai-sdk/openai@4.0.99npm registry, the published package
- @ai-sdk/openai@4.0.98npm registry, the published package
Scan your repository
Find affected code without editing your files.
npx emendant scanThen npx emendant fix writes the patches the table says exist. The getting started guide covers the flags and the patch grades.
Related release pages
- Earlier @ai-sdk/openai release: @ai-sdk/openai 4.0.0: every model is a v4 provider type now
Every @ai-sdk/openai release page is listed on one page.