Nice work building this from scratch instead of just pulling in a library. The half-open canary is the part I would watch most, because one slow success can reopen the breaker too early. I would log the state changes so you can see exactly when it trips in real use.