About new update of assistant API

openai.BadRequestError: Error code: 400 - {‘error’: {‘message’: “Can’t add messages to thread_Dm7GT6iJ6Bu1dI7E140IBj7m while a run run_AGu3weUdD0v9IkPjInPl9UvA is active.”, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: None}}

I am facing this error

You can’t creat a new run or add messages to a thread that’s currently running (active). It’s stated in the DOC. Just find ways of ensuring you don’t create a run to a thread whose run hasn’t yet completed

if i send a new message how i cancel all old active run

How can i check there is any active run for a current thread.


If you haven’t been keeping track, you can pull the thread IDs out of those.

but it shows all list that is completed or cancelled. how we keep track that any run is active or not because if any run is active for a track it generate an error all time

The list of run objects (which you can view in the sidebar code near the link destination) will also show the status of the run.

yes i can see but i didn’t find any way to handle next message till current run is active. because in server it take too much time to response .