[400] Thread thread_XXX already has an active run run_XXX (ChatGPT assistant on Telegram Bot)

Hi!

I’ve created a ChatBot on Telegram using a ChatGPT assistant by following the steps outlined in Telegram chatbot (incomplete) - #2 by Dorian_Ben_Haim. It has thread memory and works well.

The problem arises when I send two or three messages simultaneously within the same thread. I get an error stating that the assistant already has an active thread and cannot handle a new one, which causes the scenario to stop.

Error:
[400] Thread thread_XXX already has an active run run_XXX.

How can I solve this?

Thanks a lot!
:slight_smile: