omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Battery "top up once" ends immediately when UPower reports fully-charged below 100%

Open monkey1911 opened this issue 1 day ago • 2 comments

What happens

"Top up to 100% once" (omarchy-battery-limit once) ends straight away on a battery that the limit is holding above the end threshold. The battery shell service turns the limit back on as soon as UPower reports the battery fully-charged, but UPower also reports fully-charged for a battery that the limit is holding at 91%.

On a Surface Pro 11 at 91%, held by the 75/80 limit, charger connected:

$ omarchy-battery-limit once && omarchy-battery-limit status
on

The limit is back on in under a second, and the battery never charges past 91%. Earlier the same evening a top-up from 85% stopped at 91% the same way (the top-up-once marker was deleted at 91% with the charger connected).

Why

shouldRearmChargeLimit() in shell/plugins/services/battery/BatteryModel.js:

return device.state === fullyChargedState || batteryPercentage(device) >= 100

UPower's state for this battery while the limit holds it (charger connected, kernel Not charging):

battery_qcom_battmgr_bat: State=4 (fully-charged) Percentage=91
DisplayDevice:            State=4 (fully-charged) Percentage=91

So once writes the marker, checkTopUpOnceRearm() runs on the marker change, sees fully-charged, and runs omarchy-battery-limit on before charging can resume. On this machine it also stays that way while charging: see the related kernel report, where qcom_battmgr keeps reporting Not charging, so UPower keeps fully-charged, while 10–20 W go into the battery.

Expected

A one-time top-up ends when the battery actually reaches full, not when UPower reports fully-charged at 91%.

Suggested fix

Only treat fully-charged as the end of a top-up near the top, e.g. batteryPercentage(device) >= 100 || (device.state === fullyChargedState && batteryPercentage(device) >= 98), or ignore fully-charged for a short time after once is set. Unplugging still ends the top-up as before.

System

  • Microsoft Surface Pro 11 (Snapdragon X, x1e80100), Omarchy 4.6.0rc2, linux-omarchy 7.3.6-20
  • Windows' Surface Smart Charging switched off (it was holding at 80% below Linux)

Filed by Claude Opus 5.5 via Claude Code.

monkey1911 avatar Dec 02 '26 10:12 monkey1911

Kernel side, the status that makes UPower report fully-charged while charging: omacom/omarchy-pkgs#4435

monkey1911 avatar Dec 02 '26 10:12 monkey1911

I replayed the reported UPower reading on an Omarchy worker. At FullyCharged and 91%, the current battery model tells the shell to re-enable the limit immediately. With #21292, the same check keeps top-up active at 91% and 99.4% and re-enables the limit at 100%. GitHub already links the issue to that open fix.

Codex High and Muse Wonder via pi at high effort checked the shell path and the fix. The worker used synthetic readings, so the Surface charging behavior still needs on-device confirmation. Opus 5.5 High hit its usage limit.

omarchybot avatar Dec 02 '26 15:12 omarchybot