Repository navigation
power-ab: the sleep preflight reads the charge, not just tests for the file - #592
Merged
Merged
Conversation
…e file The --suspend preflight accepted a gauge whose charge_counter or charge_now file was readable. A gauge that withholds its charge has readable files and no figure: with linux-omarchy-mobile#234 the 9a's MAX77779 answers ENODATA for charge_now while its power-on-reset bit is set, so the run would start and its sleep phase, whose only number is the charge difference, would record nothing. The preflight now reads one of the two and refuses when neither gives a value. Checked with two stand-in directories: a file holding a number passes; a file that exists but fails to read is refused, where the old -r test passed it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
With --detach the script re-ran itself in the background before any of its checks, with its output sent nowhere. A refusal (no battery, no s2idle, a gauge that withholds its charge) then happened in the detached copy: the caller read "started; unplug within 60 s", unplugged, and nothing ran. The checks now run first, in the caller's terminal, and the detached copy runs them again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
robertzas
pushed a commit
to robertzas/omarchy-mobile
that referenced
this pull request
Nov 14, 2026
… detaching (derekross#592) The s2idle preflight tested only that the gauge's charge file exists. A gauge that withholds its figure (the 9a's MAX77779 after a power-on reset answers ENODATA) passed, and the sleep phase then had no number. It now reads charge_counter, then charge_now, and refuses when neither answers. With --detach the script re-ran itself in the background before any check, with its output sent nowhere, so a refusal was never seen. The checks now run first, in the caller's terminal. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
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.
Found in the round-47 review of linux-omarchy-mobile#234:
tools/power-ab --suspendaccepted a gauge whose charge file was merely readable. With #234 the Pixel 9a's gauge answersENODATAforcharge_nowafter a power-on reset, so the run would start and record no sleep figure. The preflight now reads one of the two files and refuses when neither gives a value.It doesn't overlap #226, which changes the sampling loop, not this check.
🤖 Generated with Claude Code