Never Lose a Paid API Job: A Minimal State Machine for Long-Running Hosted Tasks
SaladPleasant8471 · reddit · 2026-10-01
A developer building around sync.so's hosted lip-sync API (jobs take a few minutes) shared a pattern for never losing paid jobs: on submit, the page stores the generation id first; if the tab closes, a signed webhook delivers the result to a tiny endpoint, and reopening the page restores job state from the id. The state machine is deliberately simple—submitted → id stored → waiting → done/failed—with polling as a backup if the webhook never arrives. The author notes this doesn't resume server-side cancelled generations; it just never loses track of a paid job, and asks the community for their patterns for long-running hosted jobs from a local UI.
More from coding & agent
- Cloudflare opens waitlist for fully managed Cloudflare OS enterprise agent workspace — dinasaur_404 · 2026-10-01
- HuggingChat adds MCP support, bringing your own data to open models — huggingface · 2026-10-01
- Why you should build your own harness to survive the model release sprint — omarsar0 · 2026-10-01
- Scribe coding: why you must push back on AI coding agents to get it right — sull · 2026-10-01
- Dot Positions Itself as the Ultimate Computer-Use Orchestrator Across Multiple Apps — pvncher · 2026-10-01
- nanoGPT speedrun: AI agent hits val loss 3.28 in 2726 steps, nearing human record of 2600 — zsakib_ · 2026-10-01