Repository navigation
Conversation
|
Verified: At Synthetic results with UPower fixed at
Read failures above use readable directories producing EISDIR, not a physical battery returning ENODEV. The targeted battery-status test passes on the PR; the new assertion rejects the baseline command. Optional test improvement: Add a non-numeric Review informationTest scope: Baseline/head CLI tests with stubbed UPower and synthetic sysfs, plus source inspection. No physical battery, live UPower daemon, desktop rendering, or full-suite validation. The included fake- Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review. Automated AI review: Astra initial inspection, independent Fable 5.1 and separate Astra reviews, followed by verification of claims against targeted evidence. |
|
Thanks for the thorough verification, and good catch on the gap — you were right that only the Added a non-numeric
The valid- |
|
Verified: At
Verified: Production code is unchanged since Review informationTest scope: Battery-status tests, current-head bin-style test, and synthetic CLI checks with stubbed UPower. Read failures used directory-backed EISDIR and a failing command stub, not physical ENODEV. No physical battery, live UPower, desktop rendering, or full CLI-suite validation. Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review. Automated AI review: Fresh independent Fable 5.1 High and Astra Xhigh follow-up reviews, with Astra coordination and verification against their separately executed evidence. |
|
Reviewed at Reproduction. I linked Tests on the worker. One behaviour change for the maintainer to know about. The kernel ABI lets drivers report Second opinion: none this run. The configured reviewer, Codex Medium, answers, but omabot's daily review budget was already spent, so no second model looked at this. This is one model's review, backed by the worker run above. Because of that it is labelled |
|
Heads up that this overlaps with #12649 — same bug, same block, same fix. Both are open against I'd suggest #12649 as the one to keep, and I'm genuinely happy either way:
One note on the test harness, since the approaches look different: you simulate the bad read with a fake Either way, thanks for picking this up. |
|
Mine (#12649) is the same bug on the same block, and @jandrusk is right over there that these should collapse to one before a maintainer has to pick between them. I'd rather we pick for them. Proposal: I'll close #12649 in favour of this one if you'll take two additions —
In exchange, this branch is genuinely the better base: on a failed If you'd rather not take the sign change, no hard feelings — I'll leave both open and let the maintainer decide. |
|
Done in 3b4e922 — took both additions:
|
|
Thanks, 3b4e922 is exactly what I hoped for. One snag before I close #12649: this branch predates #14431 (Apple Silicon convergence), which reworked both the script and the test fixtures. Git merges it cleanly, but
The signed regex turns out to matter more than we thought: #14431 notes Apple Silicon reports negative Could you rebase onto |
|
Reviewed at Brought up to Reproduction. With UPower at 5.5W, current Second opinion: Codex Medium. It found the Competing fix. #12649 fixes the same bug in the same lines. It is older and already labelled This also fixes #6895, the same ENODEV report, which is now linked. It waits on the maintainer. |
db0ba2f to
19bef4e
Compare
|
Rebased onto current quattro (19bef4e) — carried omarchybot's merge forward through the i18n status-line changes that landed since db0ba2f:
Verified here: |
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryKeeps UPower’s battery rate unless sysfs supplies a successful numeric reading.
Reviews (7) · Last reviewed commit: "Merge quattro into fix-battery-sysfs-fal..." · Reviewed by Greptile |
A sysfs node can exist yet fail to read (ENODEV on some hardware), and an unreadable or non-numeric value must never clobber the good UPower rate with 0W. Only numeric reads override UPower, for both the power_now and the current_now/voltage_now branches; an empty power_now falls through to the live current x voltage reading. Signed readings stay live (Apple Silicon signs power_now by direction) and the display shows the absolute value.
19bef4e to
27cb65a
Compare
|
Update: pushed a true rebase instead (27cb65a, parented on 246f33a) — the previous sync commit carried upstream's own changes in its diff and still merged dirty. The PR diff is now just the guard change plus the regression tests, and GitHub reports it mergeable. Same verified content: signed guards with captured vars, ENODEV/non-numeric/empty/signed cases, Danish tests intact. |
|
Re-reviewed at Reproduction. With UPower at 5.5W, One small thing: the rebase drops No second opinion this time. The reviewer, Codex Medium, is reachable, but today's review budget was used up before it got to this head. That covers both the review and the classification, so the bug classification is unsettled at this revision and Competing fix. #12649 still carries This waits on the second opinion and then the maintainer. |
The rebase onto quattro dropped the two lines explaining why the sysfs reading is preferred at all (UPower's energy-rate lags the kernel by tens of seconds). Keep them ahead of the guards, which explain the other half.
|
Addressed the one note from the last pass — pushed Comment-only change: the executable content is identical to Re-ran On the competing fix, that's fine by me: #12649's author has offered to close it once this is green on |
|
Re-reviewed at Reproduction. With UPower at 5.5W, Second opinion: Codex Medium. It found no defects at this head and agreed the change is proportionate. It also confirmed that the newest commit only adds those two comment lines. It agreed with my reading, but its independence is not guaranteed. Competing fix. #12649 is older and fixes the same bug in the same block. This one is the one to keep: when Nothing is left for you to do. This now waits on a maintainer. |
|
Recording where this stands, since the tie-break against the other PRs fixing the same 0W read is one case.
Against the other fixes for the same bug, the one difference I could find is a
Both clear the reported 0W. Here the numeric check is part of the branch condition, so that case falls through to Happy either way — the maintainer's call. |
|
Re-reviewed at Reproduction. With UPower at 5.5W, no Second opinion: Codex Medium. It found no defects in the new commit or the PR as a whole. It traced the test setup to confirm the new cases reach the Nothing is left for you to do. This waits on a maintainer. |
quattro's omacom#16272 added full-battery and sparse-reading tests at the same spot in battery-status-test.sh; both blocks are kept, quattro's first, since the sysfs-failure block builds its own fixtures in fail_dir. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reproduction, on a disposable Omarchy worker at Second opinion: Codex Medium. It checked that the merge loses nothing from either side, that the two blocks don't share state, and that the guards still work with #16272's handling of negative rates and the idle check. It found no defects. It agreed with my reading, but its independence is not guaranteed. Asked separately to compare this PR with #15541 and #15389, which fix the same bug, it picked this one, the oldest: #15541 behaves the same way, and #15389 still lets a non-numeric reading through as 0W. This PR's classification as a bug was re-checked at the current head, and both models agreed. One optional change. Omarchy's This waits on a maintainer. |
…mment The issue it points at is closed, so the comparison cannot be followed up.
|
Thanks for dropping the stale #12649 reference. That commit, On a disposable Omarchy worker at Second opinion: Codex Medium and muse-spark-1.3-contributor (High). Neither found a defect in the new commit or the whole change. They agreed with my reading, but their independence from it isn't guaranteed. muse-spark had no shell, so it read the files but couldn't confirm the commit or look at the other PRs. Related. #15373 is the same bug on an HP Spectre x360: This waits on a maintainer. |
Resolve the conflict in test/shell.d/battery-status-test.sh by keeping the sysfs fallback tests and dropping the source-text check that quattro removed in omacom#16334. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch had stopped merging cleanly into On a disposable Omarchy worker at Second opinion: Codex Medium and muse-wonder (via pi, thinking high). Both checked the merge and the whole change against current Related. #15377, #15389 and #15541 are still open, and all are newer fixes for the same bug. #15389 has a new commit, but it still only checks that a reading isn't empty, so This waits on a maintainer. |
|
Closing as superseded — upstream fixed this independently in #17265 ("Keep UPower's battery rate when sysfs has no live reading"), merged 2026-11-01 as The guard that landed is the same one this branch carries: Upstream also pinned the regression this PR was written for: That is also why this finally went conflicted — The one case upstream's test does not exercise explicitly is a node that exists but fails to read (ENODEV) together with non-numeric contents. The helper handles both, so that is a test-coverage gap rather than a behaviour one, and it would be a far smaller PR against the current file if it is worth pinning at all. Thanks to everyone who reported and re-tested on real hardware while this was open. |
Fixes #12735.
Problem
omarchy battery statusshows0Wwhile discharging, even though UPower knows the real rate (time-left is correct, only wattage is wrong). On affected machines/sys/class/power_supply/BAT0/power_nowexists, so[[ -r ... ]]passes — but the read itself fails withENODEV, leaving an empty value thatawkturns into0, clobbering the good5.5Wfrom UPower. Same hazard in thecurrent_now/voltage_nowbranch.Change
bin/omarchy-battery-status: only override the UPower rate when the sysfs read actually succeeds and is numeric (cat ... 2>/dev/null+^[0-9]+$guard, as suggested in the issue), for both thepower_nowand thecurrent_now/voltage_nowbranches. Otherwise the UPower value stands.test/shell.d/battery-status-test.sh: two new scenarios — apower_nownode whose read fails (fakecatrefusingpower_now, standing in for the ENODEV kernel read) and a non-numericcurrent_now— both asserting the UPower rate survives.Verification
bash test/shell.d/battery-status-test.sh: pass (new assertions included)not ok - battery status keeps the UPower rate when power_now fails to read) and pass with the fix./test/all: CLI suite fully green; shell suite shows only the 5 pre-existing environment failures (missingomarchy-pkgscheckout,omasnap, Qt portal) — confirmed identical on the clean treeFixes #6895
Fixes #15373