Release
AI SDK 7.0.163 Added Two Stream Parts in a Patch Release. My Exhaustive Switch Stopped Compiling
The Brief
- AI SDK 7.0.163 is a patch release that adds two new members to the fullStream part union returned by streamText.
- Code that loops over fullStream and switches on part.type with an assertNever fallback fails type checking after upgrading from 7.0.162 to 7.0.163 or later.
- The runtime behaviour is unchanged; the breakage is a compile-time type error caused by the new union members.
Why it matters
Patch upgrades that widen a union can break exhaustive type checks in projects that depend on the AI SDK, even though no runtime behaviour changed.
Who’s affected
- Teams using the ai package with streamText and fullStream
- Developers using exhaustive switch statements with assertNever on stream part types
What to do
- Add handling for the two new stream part types in exhaustive switches over fullStream when upgrading to 7.0.163 or later.
- Pin the ai package to 7.0.162 if the type change cannot be handled immediately.
- AI SDK 7.0.162
- AI SDK 7.0.163
- #ai-sdk
- #typescript
- #streaming
- #breaking-types
- #patch-release
If you loop over fullStream from streamText and switch on part.type with an assertNever fallback, bumping ai from 7.0.162 to anything from 7.0.163 up will break your type check. Nothing is wrong at runtime. The union just got two new members in a patch release. I hit this on…