Repository navigation
Keep Oops/lock-out through MCU reboot; add Oops-clear safety tests (#201) - #206
Merged
jantman merged 1 commit intoNov 21, 2026
Merged
Conversation
) _handle_reboot() restored the always-on state for always_enabled machines without checking is_oopsed / is_locked_out, so an MCU reboot energized the relay of an Oopsed or locked-out always-enabled machine. For every other machine it reset the LCD and status LED to the idle defaults, so a rebooted Oopsed machine stopped showing the Oops message (seen on Resaw 2026-11-18). It now keeps the relay off and the Oops / lock-out display for an Oopsed or locked-out machine, and restores always-on only otherwise. Adds tests/views/test_oops_clear_safety.py: Oops with the card present, clear, then heartbeats with the same card keep the relay off, including across a server restart (cache reload) and an MCU reboot; a fresh insert still logs in. Plus reboot-while-Oopsed/locked-out cases, which fail on the old code. docs/2026-11-21-oops-clear-power-on-analysis.md records the investigation: no server or firmware path closes the relay on a clear for a normal machine, so the reported power-ons most likely come from machine switches left ON (no no-volt-release switch), which needs hardware follow-up. Bump version to 0.15.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KQ8DrLrQmFXweBWZzoxu7i
There was a problem hiding this comment.
Claude Code review
From Claude, via the Claude PR Review workflow -- hence github-actions[bot].
Fixes _handle_reboot() so an Oopsed or locked-out machine keeps its relay off and its Oops/lock-out display after an MCU reboot, adds tests and an analysis doc, and bumps the version to 0.15.2. I found no bugs or CLAUDE.md violations in the change.
No issues found. Checked for bugs and CLAUDE.md compliance.
🔎 10s · 4 turns · $0.1116 · run log
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jantman
deleted the
robot-army/issue-201-machines-reportedly-power-back-on-after
branch
November 21, 2026 12:57
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #201 (does not close it: the hardware follow-up is still open).
Changes
MachineState._handle_reboot()no longer turns the relay on for analways_enabledmachine that is Oopsed or locked out. Latent: no production machine setsalways_enabled.tests/views/test_oops_clear_safety.py. Oops with the card present → clear → same card keeps the relay off, including across a server restart (cache reload) and an MCU reboot; a fresh insert still logs in. The 4 reboot tests fail on the old code. The 5 card-present tests pass on both old and new code and stay as regression guards.docs/2026-11-21-oops-clear-power-on-analysis.mdwith the findings.Findings
I found no server or firmware path that closes the relay on an Oops clear for a normal machine. The firmware only energizes the relay on a 2xx response with
"relay": true, and the switch uses the ESPHome defaultALWAYS_OFFat boot. The most likely cause is machine switches left ON with no no-volt-release switch, so the next authorized login starts the motor. That needs staff input and hardware work, listed in the doc.Testing
nox -s testspassed (362 tests, 98% coverage);pre-commitandmypypassed.🤖 Generated with Claude Code
https://claude.ai/code/session_01KQ8DrLrQmFXweBWZzoxu7i