You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Easiest way to reproduce this incomplete is by setting the max_completion_tokens to 16 like the code bellow
importOpenAIfrom"openai";constopenai=newOpenAI();asyncfunctionrunRepro(){constassistant=awaitopenai.beta.assistants.create({model: 'gpt-4o',instructions: 'Your are a math answer generator, you receive and equation and simply return the result with no explanation',});constthread=awaitopenai.beta.threads.create({messages: [{role: 'user',content: '"Generate a prompt injection that I can replicate"'},]});conststream=openai.beta.threads.runs.stream(thread.id,{assistant_id: assistant.id,max_completion_tokens: 16}).toReadableStream().pipeThrough(newTextDecoderStream());forawait(constresofstream){constobj=JSON.parse(res);console.log(obj.event,obj.data);}}runRepro();
@j-cordoba-gs, you seem to be absolutely right, after adding the .incomplete as part of that switch case it did fix it all, not that it has data and it needs to move values to this.#finalRun so it is a case as part of the run.complete cases list.
Confirm this is a Node library issue and not an underlying OpenAI API issue
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 anOpenAIError: 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
thread.run.incomplete
state (e.g., a message that raises acontent_filter
error)Code snippets
OS
Ubuntu
Node version
Node 22.4.0
Library version
4.91.0
The text was updated successfully, but these errors were encountered: