@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

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.

ChangeSeverityDetectsFixVerified by
Changed the members of OpenAILanguageModelResponsesOptions
ai-sdk-openai-npm-4.0.99-open-ailanguage-model-responses-options-members-changed
Breaking
medium confidence
  • OpenAILanguageModelResponsesOptions imported from @ai-sdk/openai, named in any type position
Patch, only when you name a model providerYour typecheck and tests
Changed the members of OpenAIResponsesProviderOptions
ai-sdk-openai-npm-4.0.99-open-airesponses-provider-options-members-changed
Breaking
medium confidence
  • OpenAIResponsesProviderOptions imported from @ai-sdk/openai, named in any type position
Patch, only when you name a model providerYour 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

Scan your repository

Find affected code without editing your files.

npx emendant scan

Then npx emendant fix writes the patches the table says exist. The getting started guide covers the flags and the patch grades.

Every @ai-sdk/openai release page is listed on one page.