AIエージェントの作業中にマシンが止まったら、続きはどうなるんやろ。
Cryoの作者はFlyのSprite上で、メモリや開いてるファイルを保存して、復帰時に同じプロセスIDで再開する仕組みを作ったそう。自身の環境では3つのエージェントが自動で復元できたって。
https://x.com/i/status/2126732830910685518
@ThePythonBoy352For fifteen years we've taught ourselves that servers are cattle, not pets. Kill them, replace them, nobody cries. Everything that matters lives in a database. The process is disposable.
AI agents broke that rule and almost nobody noticed.
An agent's most valuable state isn't in a database. It's in the process. The conversation it's holding, the plan it made an hour ago, the approaches it already tried and threw away, the file it was halfway through reading. None of that is written down anywhere. It lives in RAM, and RAM dies with the machine.
On your laptop that's fine. Nothing restarts unless you tell it to. In the cloud, machines sleep, wake up cold, move hosts and get restored from checkpoints all the time. Every one of those kills the agent, and you come back to a fresh process with no idea what it was doing.
So this week, for @flydotio Hacksgiving, I built Cryo. It makes the process itself the thing that survives.
Cryo watches your agents on a Sprite. When one finishes a bit of work, it freezes the whole process to disk with CRIU: every page of memory, every open file, the terminal it's attached to. The agent pauses for about a third of a second and carries on. When the Sprite comes back from anything, Cryo thaws it. Same PID. It picks up mid-thought.
The moment I believed it wasn't a demo. Friday, 7:48 in the morning. The Sprite went cold and came back on its own, the way Sprites do, and every process on it died. Cryo noticed, put all three agents back and emailed me. Nobody pressed anything.
What I didn't expect was how hard the platform would push back. Sprites strip permissions CRIU leans on. A restore doesn't look like a reboot from the inside. Timers only count time the machine is awake. Clocks don't travel between machines, which I learned by moving a live Claude Code session to another Sprite and watching it freeze solid behind ten hours of timer debt. Seven of these in total. I wrote them up on the Fly forum with the workaround for each.
I think this is a real gap. We've built a lot for agents' files and tools, and very little for the agent itself staying alive. Durable execution exists for workflows. Durable processes for agents mostly don't. A long-running agent should survive losing its machine the way a laptop survives closing the lid.
You can try it right now. There's a button on the site that kills our real Sprite. Leave a word in a process's memory, press it, and watch everything die and come back holding your word. It's not a recording.
Kill our Sprite yourself: https://cryo-labs.vercel.app
Code: https://github.com/miracle352/cryo
The 7 Sprite findings: https://community.fly.io/t/freezing-running-agents-on-sprites-with-criu-7-things-the-docs-dont-mention/29179