Skip to content

SDK crashes on response.output_item.done for missing item #110

Open
@devpras22

Description

@devpras22

The @openai/realtime-api-beta SDK crashes when it receives a response.output_item.done event for an unknown or missing item ID. Instead of checking if the item exists in its internal map, the SDK immediately tries to access properties like item.tool, item.status, or item.event_id, causing a fatal error.

Here’s the stack trace:

Error: response.output_item.done: Item "item_BLqSTfYRcIduLcytDILia" not found
    at response.output_item.done (/node_modules/@openai/realtime-api-beta/lib/conversation.js:171:15)
    at RealtimeConversation.processEvent (/node_modules/@openai/realtime-api-beta/lib/conversation.js:295:27)
    at handler (/node_modules/@openai/realtime-api-beta/lib/client.js:278:49)
    at handlerWithDispatch (/node_modules/@openai/realtime-api-beta/lib/client.js:282:31)
    at /node_modules/@openai/realtime-api-beta/lib/client.js:355:24
    at RealtimeAPI.dispatch (/node_modules/@openai/realtime-api-beta/lib/event_handler.js:134:7)
    at RealtimeAPI.receive (/node_modules/@openai/realtime-api-beta/lib/api.js:180:10)
    at WebSocket.<anonymous> (/node_modules/@openai/realtime-api-beta/lib/api.js:131:14)

This crash kills the entire server. The SDK should gracefully skip missing item_ids or log a warning, but currently does neither. Please fix this as it’s blocking production use of the Realtime API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions