Assistant API cancelling a run wait until expired for several minutes

I add extra timeout check for those run cost more than 30 seconds, and …
Most of the time, it stuck in “cancelling” status , and expect it to be cancelled in several seconds.
But, most of the time the cancelling status is not changed and after several minutes(sometimes it’s more than 10) it became expierd.

Is there any problem with thread run cancel operation?
Or we cannot cancel a long long waiting run?

Thanks

4 Likes

I am having the same issue. Api status “canceling” is stuck for several minutes.

I am having this same issue. API status “canceling” is stuck for several minutes. Plz anyone here for help us

I have the same problem with canceling runs

Have this problem too. Using assistant API i can not cancel thread run because it is already on status ‘cancelling’ and can not create new ‘run’ because of error “Can’t add messages to [thread_id] while a run [run_id] is active”. It happens sometimes. What should we do with this issue? @logankilpatrick @rohancalum Tech team please help us.

Same happens to me. I solved it by detecting the run is in cancelling status and creating a new thread and executing the pipe on this new thread.
And praise for that if it’s in cancelling status, someday it will be cancelled.
Idk if that’s a good approach but I haven’t found another way.

Also having a similar problem— every once in a while the run gets stuck in “cancelling” until it expires

Hello, were you able to find a solution for this?

I have the same issue, but now a run that’s stuck in “cancelling” expires after approximately 3 minutes.

I am wondering whether one can "force expire” a run using some API method.

Otherwise, I cannot add any other run to the same thread and have to wait (too long) until it expires automatically.

I also have trouble with runs ending up in cancelled state and as a consequence, I can no longer add messages to the thread.

See also this post: Handling Errors When Adding Messages to an Active Run in OpenAI