This is a submission for *DEV's Summer Bug Smash: Clear the Lineup** powered by Sentry.*

Eliminating Non-Deterministic Exit Codes in StayPresent

Project Overview

StayPresent is an open-source Python library for supervising long-running bots and background services. It automatically restarts crashed bots, monitors their health, and exits with an appropriate status code when recovery is no longer possible.

While reviewing the crash recovery logic, I discovered that identical failures could sometimes produce different process exit codes.