International
The Morning Dev

Only the news worth knowing

‹
 

Release

AI SDK 7.0.163 Added Two Stream Parts in a Patch Release. My Exhaustive Switch Stopped Compiling

DEV · By Sushil ·

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

  1. Add handling for the two new stream part types in exhaustive switches over fullStream when upgrading to 7.0.163 or later.
  2. 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…

Timeline

  1. DEV Community article reports the type break after AI SDK 7.0.163 added two stream parts

  2. DEV Community: javascript

    AI SDK 7.0.163 Added Two Stream Parts in a Patch Release. My Exhaustive Switch Stopped Compiling

How do you feel about this?

0 Comments

    AI SDK 7.0.163 Added Two Stream Parts in a Patch Release. My Exhaustive Switch Stopped Compiling – The Morning Dev