Yes, a good chunk of improvements have gone out regarding this. Old sprites are likely stuck in their ways, as it were, new sprites will behave better.
Also worth nothing that in all or most of these cases, we won’t be billing for Sprites that are not suspending. The “trying to suspend” state isn’t represented in the Sprite status, but is a trigger for us to stop billing.
New sprite. The script that @phiat posted spins up an entire new sprite from scratch. And there’s nothing on it. It doesn’t go to sleep though. At least, that’s what happened when I tried it yesterday.
Hmm - I took my successful test with that script to be a sign that things were working properly with shutdown now. So I deleted my old sprites and decided to start again. I installed the latest version of the sprite CLI and created a new sprite, then logged into it and:
Created an SSH key
Downloaded a git repo
Started Claude Code and authenticated
That’s it. Then I exited.
That was 15 minutes ago and my sprite status is still “running”.
I don’t get why I’m having so much trouble with this. I shelled into the sprite to check processes, not much:
sprite@sprite:~# ps -ax PID TTY STAT TIME COMMAND 1 ? Ss 0:00 /.pilot/tini – tail -f /dev/null 2 ? S 0:00 tail -f /dev/null 741 pts/0 Ss 0:00 zsh --login 747 pts/0 R+ 0:00 ps -ax
Things are still in the works! Our dev Sprites are suspending correctly, so once that rolls out this will be fully resolved. Current production Sprites will behave as @adriand shows: They will suspend, but with more of a delay than we would like.
A few tricks claude taught me to figure out what’s causing it to be stuck in running:
see what processes are running in your sprite, the services command doesn’t show background ones: sprite -s <sprite-id> exec bash -c "cat /proc/*/comm 2>/dev/null | sort -u”
Background processes and services won’t keep your sprite running, only exec commands/sessions, and inbound network requests. Detached exec sessions also won’t keep it running unless they are actively producing stdout.
warm → cold has no particular guarantees either way at the moment, but this isn’t something you’ll have to think about at all. Warm and cold are both non-billed outside of storage, and your processes are not running.
I noticed much better sleeping/shutdown behavior lately. My earlier test above now returns “unknown” for the status, looks like it might take ~1m to get warm status. Either way, less hanging running sprites.
Thanks for the updates, looks like some good progress.