A bot can show as running while doing absolutely nothing — no crash, no error, just silence. Here's the failure mode most monitoring misses entirely.
Your Bot Can Be "Online" and Completely Dead at the Same Time
Here's an uncomfortable fact about how most bot monitoring works: it checks whether the process is running. Not whether it's actually doing anything. Those sound like the same question. They're not — and the gap between them is exactly where a frozen bot hides in plain sight, dashboard green, doing nothing at all.
The failure that doesn't look like a failure
A crash is loud, in its own way. The process exits, something notices, something restarts it. A freeze is different — a deadlock, a network call that never times out, a loop that silently stopped making progress. The process is still there. It's still "running" by every metric a typical host checks. It's just not doing anything useful anymore, and nothing about that state trips any of the usual alarms.
Why this one is so easy to miss
Think about what most reliability tooling actually watches for: exit codes. Restart counts. Whether something responds on a port. A frozen process fails literally none of those checks — it hasn't exited, it hasn't returned an error, and if your keep-alive server is a separate thread from the part that's actually stuck, it might keep responding to health checks perfectly fine, right up until someone notices the bot hasn't sent a message in six hours.
Making the bot prove it's actually working
The fix isn't "monitor harder" — it's giving the bot a way to actively confirm it's making progress, not just existing:
# worker.py
import staypresent
while True:
staypresent.heartbeat()
do_work()
# app.py
staypresent.run("worker.py", heartbeat_timeout=30)
If the bot goes quiet — genuinely quiet, no heartbeat, for longer than you've decided is reasonable — it gets treated exactly like a crash: logged, terminated, restarted. The difference between "crashed" and "frozen" stops mattering, because both get caught the same way.
The check you didn't know you needed
If you've never thought about this failure mode before, that's not unusual — it's one of those problems you don't know exists until it's already cost you a day of a bot doing nothing while everything looked fine. It's worth thirty seconds to ask yourself: if your bot froze right now, mid-loop, would anything actually tell you? For most setups, the honest answer is no.
pip install staypresent[prod]
Green on the dashboard isn't the same as actually working. Now there's a way to check both.
Top comments (0)