Repository navigation
Conversation
…nded watch Switching to a hands-off profile submitted resetAuto and cleared the monitor's fansCurrentlyRunning flag on bookkeeping alone. A fan write already in flight (a ramp tick racing the switch across the monitor/main queues) can land at the daemon AFTER that resetAuto and re-pin the fans in manual — and nothing ever corrects it: the flag-driven hands-off branch sees "not running" and stays silent, and with the app alive and heartbeating the daemon watchdog never reclaims the orphaned hold. The fans then stay pinned in manual until quit. Switching to hands-off (or Reset to Default) now arms a 10-second handback watch instead of submitting a bare resetAuto: hands-off ticks read the hardware fan mode, re-send resetAuto at 1Hz while any fan still reads manual, and settle once auto is confirmed. The watch keeps running past a confirmed-auto reading so a late re-pin is still caught inside the window, and it is bounded — a dead daemon or an external tool legitimately holding manual is never fought forever. Status reading is injected (defaulting to the fanControl reader) and the monitor queue / tick are internal, so the handback is unit-tested hardware-free: re-pin before confirm, re-pin after confirm, clean handback, idle hands-off quiet, and watch expiry.
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.
Problem
Switching to a hands-off profile (Silent) submits
resetAutoand clears the monitor'sfansCurrentlyRunningflag on bookkeeping alone. A fan write already in flight — a ramp tick racing the switch across the monitor/main queues — can land at the daemon after that resetAuto and re-pin the fans in manual, and nothing ever corrects it:The fans then stay pinned in manual until quit. (Reset to Default has the same shape: its daemon-confirmed resetAuto can still be superseded by an in-flight write.)
Fix
Switching to hands-off (or Reset to Default) now arms a 10-second handback watch instead of submitting a bare resetAuto:
resetAutoat 1Hz while any fan still reads manual, settling once auto is confirmed;To make this testable, the monitor's status source is injected (defaulting to the
fanControlreader) and the monitor queue/tick are internal.Testing
swift build+ fullswift testpass, including five new hardware-free tests inThermalMonitorHandbackTests: re-pin before first confirm, re-pin after confirmed auto, clean handback sends nothing, idle hands-off stays quiet in manual, and watch expiry stops retrying.