Skip to content

Responses API: ResponseTextAnnotationDeltaEvent removed in SDK 4.103.0 #1510

Open
@weevilgenius

Description

@weevilgenius

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • This is an issue with the Node library

Describe the bug

Typescript complains about streamed events from the responses API with type response.output_text.annotation.added using SDK 4.103.0. There is no issue in 4.102.0 and earlier.

> tsc

src/index.ts:18:10 - error TS2678: Type '"response.output_text.annotation.added"' is not comparable to type '"response.audio.delta" | "response.audio.done" | "response.audio.transcript.delta" | "response.audio.transcript.done" | "response.code_interpreter_call.code.delta" | ... 47 more ... | "response.reasoning_summary.done"'.

18     case 'response.output_text.annotation.added':
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in src/index.ts:18

To Reproduce

  1. Make a streaming request using the responses API.
  2. Iterate over the events in the response stream.
  3. Attempt to use 'response.output_text.annotation.added' with event.type.
  4. Observe typescript error.

Code snippets

// simple program to reproduce
import { OpenAI } from 'openai';

async function main() {
  const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
  const response = await openai.responses.create({
    model: "gpt-4.1",
    input: "Why is the sky blue?",
    stream: true,
  });

  for await (const event of response) {
    switch (event.type) {
    case 'response.output_text.annotation.added': // this fails to compile in v4.103.0
      break;
    }
  }
}

main();

OS

macOS

Node version

Node v22.12.0

Library version

openai v4.103.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions