Preventing File Expiration in ChatGPT Sandbox (TTL Workaround)
When generating files in ChatGPT’s code interpreter (Python mode), you may run into this:
Your requested file generation finishes… but expires before you can download it.
This happens because sandbox files are deleted automatically after a short TTL (time-to-live) window — and if the file finishes while you’re away or distracted, it’s gone. You don’t even have to be distracted. The assistant posts it, but unless you ping, all is silent, yet the TTL timer is already ticking.
My Simple Workaround: Touch the File’s Mod Time
Well, you can’t touch it, but you CAN ask ChatGPT to:
- Set the file’s modified timestamp 30 minutes into the future right before posting the download link.
- I ping regularly (every 5–15 minutes) so the file doesn’t expire.
- After I download, I ask it to reset the mod time to the past, so the sandbox can clean it up normally.
This method:
- Prevents lost files
- Avoids having to re-generate long builds in hopes the download works the next time.
- Respects shared sandbox resources
Why This Works
TTL seems to key off the modification time, not access time — so future-touching the file keeps it alive just long enough for you to grab it safely.
Related thread:
This problem was mentioned in this topic: Issue Downloading .pptx File – Session Expired
…but no workaround was proposed.