Make the Free Server a Lease-Bound Executor Before Your Agent Double-Fires
Description and use
The pattern ensures external side-effects are performed at most once even if the process dies on a free server, by persisting lease and status in durable storage.
Problem
AI agents on disposable free-tier servers lose in-memory state on reboot, causing duplicate side-effects when a model call is retried after a crash.
Outcome
By persisting lease and side-effect status outside the disposable server, the pattern guarantees at-most-once execution of side-effects, eliminating duplicates caused by process restarts.
Workflow
- Place task in durable queue via orchestrator
- Free server acquires lease in external storage
- Write side-effect record as pending
- Call model endpoint (retryable)
- Apply external side-effect (e.g., create GitHub issue)
- Mark side-effect record as done
- If server dies, lease expires and orchestrator re-enqueues task
- New executor checks side-effect status: skip if done, finish if pending, start from step 3 if absent
Evidence
The executor writes a side-effect record with status pending to the same external store.
If the server dies after applying effect, before marking done, the new executor sees pending and re-applies the effect.
- Record date: 2026-09-10T03:02:10.687Z