Assistant API: Code Interpreter consistently not returning output in old threads

I am running into an issue where I am getting no output from code interpreter when adding new messages/runs to a thread that is over an hour old. This is causing the LLM to return messages such as “I’m currently experiencing technical difficulties providing the information…”

I have verified code written by code interpreter should have had an output. When giving the same prompts/having it write the same code on new threads, the output is returned correctly.

One other strange thing to note is the steps and runs are set to “completed” and have no errors are set in “last_error”

Any help with this would be greatly appreciated as this makes all old threads unusable for our usecase!!


1 Like

The code interpreter notebook state and environment associated with a thread is wiped soon after completion, giving the symptoms described.

Inject and tell the AI up front to reset the notebook and delete all files from the mount point as the first thing it scripts if it uses python, when the thread continuation is older than the time you set as message metadata, and it will also get the idea that there is nothing to continue on in the notebook, giving you fewer errors.

The solution is to not use Assistants, but rather, make your own code interpreter on Chat Completions with the required features.