Repository navigation
Conversation
Firmware without an ACPI _BIX cycle-count field still reads back the kernel's own 0, which the power panel rendered as a real 'Charge cycles: 0'. Take the first pack reporting a positive count and omit the field otherwise, so the panel falls back to its unknown value like UPower does.
Automated AI review
Verified: the single-battery fix works as described. On firmware without Verified: hiding
Verified: the new tests discriminate. They pass at this head and fail against the base script at Cycle count can describe a different pack than the rest of the panelEvery other Synthetic two-pack case, with UPower selecting Impact: on a dual-battery machine where the selected pack reports no count, for example a newly replaced internal pack beside an external one, the panel shows the sibling's real count as if it belonged to the selected pack. The base already read Suggested change: read the count from the pack the rest of the output describes, keeping the Review informationTest scope: reviewed commit AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Reviewed at c52bb9c, and the fix holds up. Nothing was pushed to this branch. Reproduced on a disposable Omarchy worker VM, with a stubbed The full Second opinion from Codex Medium: it found no defects or style problems, and agreed the change is proportionate. Beyond agreeing, it pointed to the kernel's ACPI battery driver, which leaves This is labelled |
quattro now reads the cycle count from the battery UPower resolved before falling back to BAT*. Keep that order and apply this branch's rule to both reads: a count of 0, negative or non-numeric is unavailable, so the resolved battery's 0 falls through to the first BAT* with a real count and otherwise prints nothing. quattro's test fixture no longer has a BAT0 under the main battery, so the cycle-count tests now drive the resolved CMB0 pack, and cover a real count on it winning over a sibling's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With only BAT1 present, replacing the fallback's filter with head -1 still passed. A BAT0 reporting 0 ahead of BAT1's 450 is the case the filter exists for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
This branch had stopped merging into Why it conflicted. Checked on a disposable Omarchy worker VM, at b2ad663:
The full Second opinion from Codex Medium, over two rounds. It agreed the resolution keeps both intents, and that the change is proportionate. It found that the fallback test no longer covered skipping an unusable first One open question from the earlier community review: when the picked battery reports no count, the panel can show a sibling pack's count next to the picked battery's other details. It is labelled |
[Low impact] The PR appears safe to merge. SummaryReports unavailable battery cycle counts as unknown.
No actionable issues were found. Reviews (2) · Last reviewed commit: "Trim the cycle-count tests to the two th..." · Reviewed by Greptile |
|
Small correct fix for the |
quattro's omacom#17265 added a test for an unreadable current_now at the same spot this branch's cycle-count tests sit. Keep both, cycle-count tests first, since they still rely on CMB0's power_now, which quattro's test removes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
quattro's AGENTS.md asks a bug fix for the test that fails on the base branch and passes with the fix, in proportion to the change. Keep the resolved battery reporting 0, which is the bug, and a 0 pack ahead of a sibling's real count, which is what the fallback's filter is for. Drop the cases that pass without the fix or guard nothing: the resolved battery winning over a sibling, a count already covered by the native-path test, the command-substitution probe neither version could ever evaluate, and the padded, negative and non-numeric forms sysfs does not emit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Muse Wonder High <noreply@meta.com>
|
This branch had stopped merging into The conflict was in The tests are now two cases.
What went: cases that pass without the fix (the picked battery's count beating a sibling's, and a real count already covered by the native-path test), the command-substitution probe, which neither version could ever run, and padded, negative and non-numeric values, which sysfs does not produce. The PR description's last bullet still lists those cases. Checked on a disposable Omarchy worker VM, at 85d2288:
The power panel itself was not checked in a running session, because the worker has no battery. Second opinion from Codex Medium and muse-wonder (via pi, thinking high), over two rounds:
Their agreement with this review is not guaranteed to be independent. Still open for the maintainer, as #12463 asked: a battery whose firmware has a real This is labelled |
Changes made
bin/omarchy-battery-status: firmware without an ACPI_BIXcycle-count field still reads back the kernel's own0, and the power panel rendered that as a real "Charge cycles: 0" becausePanel.qml'sroot.batteryInfo.cycles || "—"fallback never fires for the truthy string"0". The field is now omitted unless a pack reports a positive count, so the panel shows its existing unknown value, matching what UPower reports for the same battery.BAT*sorts first, so a second battery's real count is not hidden by a sibling that reports nothing.test/shell.d/battery-status-test.shwith regression coverage for unusable values (0, negative, non-numeric), for real counts including padded and leading-zero forms, and for the two-pack case.Fixes #12463