You want an agent sandbox that survives overnight and over weekends without paying for the hours nobody uses it. How it works. Pricing counts active CPU and resident memory, and a paused sandbox costs only snapshot storage (Pricing). So give the sandbox no deadline and let it pause itself.
1

Create with no deadline

A timeout of -1 means no deadline, on plans without a maximum lifetime. The free plan allows one hour at most. See Lifecycle.
2

Pause when idle

Set idle minutes (1 to 10080) on create or later. The sandbox pauses once nothing has used it: no request, no open terminal, live view or SSH, no running process started through envd. The dashboard’s No limit (pauses when idle) does the same with 15 minutes.
3

Come back

come_back.py
Running processes, open files and /dev/shm carry on where they were.
A sandbox without a deadline is billed for as long as it runs. Always set idle pause, or kill it.