Skip to content

OpenAIError: Final run has not been received when thread.run.incomplete is received while streaming a thread run #1439

@j-cordoba-gs

Description

@j-cordoba-gs

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

I previously created an issue for this error: #1306 but this keeps reproducing with the same conditions.

When an Assistant run finishes with thread.run.incomplete, the library throws an OpenAIError: Final run has not been received. However, according to the OpenAI documentation, this is a valid transition, and the thread should still be able to continue.

Despite this, the library stops the event stream, preventing further continuation of the thread. This seems to be an unintended behavior, as the thread should still be available for further interaction.

To Reproduce

  • Create a new Assistant
  • Create a new Thread for that assistant
  • Add a new message that raises a thread.run.incomplete state (e.g., a message that raises a content_filter error)
  • Start the run in streaming mode
  • Observe the error be thrown from the library

Code snippets

OS

Ubuntu

Node version

Node 22.4.0

Library version

4.91.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