Assistant API says run is completed but there is no assistant message

We’re facing some odd behaviour from the API, which seem to work most of the time but not always.

E.g. we submit a run and poll for the status.
The run has status completed and it is completed_at 1706094534.
When I fetch the list of messages there is no assistant message tho.

The list of message timestamps spans a time that should cover this message, so I’m confused as to why it’s not there.

1706094417, 1706093911, 1706093879, 1706093832, 1706093804, 1706093732, 1705938099, 1705913500, 1705913422

Is this expected behaviour? I see multiple threads of people experiencing what seems to be same issue, maybe it should be documented somehow?

I’m having the same issue, were you able to find a workaround?

no, I have accepted the API is just half-broken.

1 Like

I’m having problems with Assistants API too. I’ve made no code changes, and as of a few days ago my app crashes randomly during a run. I’ve not tried to find the exact fault yet. I’m not sure I’ve got the motivation to find it tbh, it’s an intermittent fault, maybe 1 in 10 runs. Thinking about it it has only appeared since I changed from using GPT4 to GPT 3.5, not sure if that’s just co-incidence.

GPT-3.5 might be the cause of your problems, since there have been other people that have had to change from GPT-3.5 to GPT-4 just to address a lot of random issues with the Assistants API.

This ended up being an issue on my end, I was adding messages to the thread but not creating new runs, I only created one run at the start.

Creating new runs on the same thread after each message I send fixes the issue.

const run = await openai.beta.threads.runs.create(thread.id, {
     assistant_id: assistant.id,
});

I also check the run status with a while loop every 10 seconds until the status is completed, then retrieve the messages w.ith openai.beta.threads.messages.list

I too had the same issue use wait for 2 seconds and then read list of messages the response message will be generated. I know its frustuating to do like this. we dont know how long will it takes to generate response. sometimes the message is there in list sometimes not depending on the length of response.

This is an expensive bug. I’ve increased my wait times, but it says complete, but nothing is there. I have to retry the run 3-4 times sometimes. So, basically my costs are 4x what they should be… Can someone at OpenAI please check the code to see why the status is complete, if no message from the assistant is ever generated? It’s almost scammy how poorly it works and how it eats your tokens to return nothing. Glad I am not alone in this, for now, we will have to eat the cost of this bug.

2 Likes