How to debug run.status==expired?

Suddenly some runs are popping up as expired runs, how do I debug this and how can I know what is the reason for expiry of the run? (Apart from the time contraint)

The typical reason for run expiration is in not returning tool call results when a tool call is invoked as a requires_action status.

Thus, if this status is changed to expired, you can look at run steps for diagnosis, to see what let up to that during processing of a run.

The function prints run.status every 1 second and it printed run.status==queued before going expired (no state change to requires_action), and this happened once, what I observed for ‘requires_action’ is that the run status will be ‘failed’ if it does not get a response for the action not expired.

I’m trying to understand the underlying flow of how a run is queued what takes time for run to go from ‘queued’ to ‘in_progress’, but I never faced this ‘expired’ state. The API reference page is of very little help for this.

You will not find anything documenting that Assistants API is its own application run by OpenAI with resource limitations, running on different servers that are actually making the same calls you could have made (if OpenAI allowed placing your own tool recipient handlers), or that they have a queue or holdback mechanism and the platform itself is a cause of slowdown, failures, undocumented behaviors, and increased expenditures with lower transparency and non-functioning controls to costs.

It is through experience that you will be able to offer your opinion in each of these areas, to then recommend if the assistants platform fills any need for any of novice, intermediate, or expert.

The best you can do in this particular case is:

  • Sudden changes to behaviors → sudden changes by OpenAI. Re-evaluate your tolerance to this.
1 Like

I’ve had this pop up recently too in the past couple of days. Runs will switch from “queued” to “expired”, sometimes when it’s supposed to wait for the tool_call return, other times just because.

This always correlates with significant updates to the API. The week or two before a major update is always full of errors like this. My users get upset, but all I can do is shrug and say, “it’ll get better soon!”

Engineers have been vague-posting about “cooking” and API upgrades in these past couple of days too, so I suspect we’ll see something relatively soon.