Tim Stewart
Tim Stewart4mo ago

I got no response from system, so after about a minute I wrote "Hello?" got this error

It seems like there should be a queue system to avoid this error... and/or some kind of run abandonment after a certain length of time. in the logs: 400 Can't add messages to thread_HGCofP5gEjBN3YPyQyunApPQ while a run run_mFsQgl4yVf95jQimV5UwQpYC is active. in the chat: {"error":{"status":400,"headers":{"alt-svc":"h3=":443"; ma=86400","cf-cache-status":"DYNAMIC","cf-ray":"88ea986a0a091404-ORD","connection":"keep-alive","content-length":"217","content-type":"application/json","date":"Tue, 04 Jun 2024 20:15:31 GMT","openai-organization":"user-cyne7vaxre65dwua7c51gyf9","openai-processing-ms":"27","openai-version":"2020-10-01","server":"cloudflare","set-cookie":"__cf_bm=KsbgFY.OWoqhokw229.xBI0t_aeJQLttD_3XXrkWsCc-1717532131-1.0.1.1-2AWlz1GqHuySLv6xsSCUzCipseLeBkG7_W4Be1jU8o_3a66npH9BhxE6qedpJ87a1vZHyrCz8.YelNfD33JScg; path=/; expires=Tue, 04-Jun-24 20:45:31 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None, _cfuvid=eLBN7kMjbi2VTjXiaD_AMQaNwW3TtRH_UUQaGInR6cg-1717532131008-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None","strict-transport-security":"max-age=15724800; includeSubDomains","x-request-id":"req_911d355db879da1bf60086f2951b01f2"},"request_id":"req_911d355db879da1bf60086f2951b01f2","error":{"message":"Can't add messages to thread_HGCofP5gEjBN3YPyQyunApPQ while a run run_mFsQgl4yVf95jQimV5UwQpYC is active.","type":"invalid_request_error","param":null,"code":null},"code":null,"param":null,"type":"invalid_request_error"},"label":"OpenAI Assistant (Stream Response)","message":"400 Can't add messages to thread_HGCofP5gEjBN3YPyQyunApPQ while a run run_mFsQgl4yVf95jQimV5UwQpYC is active."}
4 Replies
Tim Stewart
Tim Stewart4mo ago
Sorry, for additional context this is an OpenAi streaming assistant chat I'm referring to.
Gaurav Chadha
Gaurav Chadha4mo ago
Hi @Tim Stewart, Did you tried adding the Assistant in loop if you are updating and adding message to multiple threadID in sequence?
Tim Stewart
Tim Stewart4mo ago
That was in a single chat, I can't imagine why the threadid would change during that?
Gaurav Chadha
Gaurav Chadha4mo ago
Makes sense, yes the chatId should be same for a single chat instance, I tested it with our chat bot widget and the does uses single chatID, you can share your workflow via in-app suppor, we can take a look at.