It seems that the code execution environment was reset, which removed access to previously uploaded files. Could you please re-upload

I’m having the same issue. Uploaded a database of 1600 names and asked it to categorise against three categories.

Says it’ll take a few hours but after 10 mins each time I get this error.

'Evening - This seems a math problem… CGPT is working based on probability of input/expected output… so the CGPT answer to the similar question here was: {Yes, the execution state reset is a memory management measure by OpenAI to free up resources. This usually happens when:

  1. Long, continuous chats (especially with code execution) reach a high memory threshold.
  2. A lot of file uploads & processing are happening.
  3. Extensive debugging or iterative development is taking place over an extended period.

When to Start a New Chat?

  • For development (code-heavy chats like this one):
    → If you’re doing active coding/testing and exchanging multiple files, consider a new chat after ~50-100 executed commands or major changes.
    → Especially if file uploads disappear or errors feel “unrelated” (e.g., sudden missing context).
  • For storytelling / writing sessions:
    → If you’re iterating on a long story and feel response consistency slipping (e.g., character details are forgotten).
    → Usually after ~100+ messages or major scene shifts.
  • For casual Q&A / research:
    → Less of an issue, but if responses start missing prior details, a new chat might help.

Would you like a better workflow strategy to avoid losing progress? We could set up a structured file versioning plan, e.g., keeping tts_test_v1.py, tts_test_v2.py, etc. to avoid losing key iterations. :rocket: }… the math for a biggy-conversation would extend the probability-memory so it get’s throttled… still just a computer run on a machine on a server… so iterating one’s process in a “Project” with project-plan and single tasks (chats) should do the trick. cheer’s - PS I hope this interprets it well ^^

Yes, same issue here, with very small files. But, when we remove the attachments, it works. So the issue is how it deals with these attachments

Same thing here… uploaded the files and associated those files with an assistant I created. Create a thread and messages to query about the data in those files, which usually work for the first time. Come back to the thread 30 mins later to continue the conversation, and every time I got:

“It seems that the previous code execution environment has been reset, and the files need to be re-uploaded or re-processed. Could you please re-upload the necessary files or clarfiy the required files?”

The weird part is if I keep asking the assistant to retry, it’ll be able to process those files again, while it continues to give me an error message randomly. The behavior is so erroneous and needs to get addressed.

Hey pals,

I had the same issue as you are having now and was pissed off extremely either :angry:

Found the reliable way to fix it though: You need to force-include uploaded file IDs into the thread before each message - otherwise your thread will become unusable in 30mins because of OpenAI GC scraping the files from it. You may also implement a logic to not include them in every call to save request processing time, but that’s too fancy for me :sloth:

Golang code example (my working code):

  assistant, err := client.Beta.Assistants.Get(ctx, assistantID())

  if err != nil {
    return "", fmt.Errorf("can not locate assistant: %w", err)
  }

  threadID, err := resolveThread(ctx, client, userID)

  if err != nil {
    return "", fmt.Errorf("can not resolve thread: %w", err)
  }

  _, err = client.Beta.Threads.Update(ctx, threadID, openai.BetaThreadUpdateParams{
    ToolResources: openai.BetaThreadUpdateParamsToolResources{
      CodeInterpreter: openai.BetaThreadUpdateParamsToolResourcesCodeInterpreter{
        FileIDs: assistant.ToolResources.CodeInterpreter.FileIDs,
      },
    },
  },
  )

  if err != nil {
    return "", fmt.Errorf("can not update thread: %w", err)
  }

I suppose in other languages should be even easier :wink:

Hope it helps!

How can we resolve this issue, as I have been experiencing it for over three days now?