Skip to content

Keep one-time battery top-up active until full - #21292

Open
Cynnamoroll wants to merge 2 commits into
omacom:quattrofrom
Cynnamoroll:contributions/battery-topup-21286
Open

Cynnamoroll wants to merge 2 commits into
omacom:quattrofrom
Cynnamoroll:contributions/battery-topup-21286

Conversation

@Cynnamoroll

Copy link
Copy Markdown
Contributor

What changes

UPower can report FullyCharged below full and end a one-time top-up immediately. While plugged in, restore the charge limit only when a finite percentage reaches 100% on the panel's existing rounded scale. Below-full or missing readings leave the top-up pending. Use the actual power-source change to start the existing unplug debounce; a sustained unplug still ends the top-up below full. Retry behavior is unchanged.

Fixes #21286.

Verification

  • The new regression failed on the unchanged base for FullyCharged at 91%. All 38 battery checks passed on the candidate, including rounding, invalid or missing readings, and unplug gating.
  • In isolated Arch with private synthetic UPower and the real battery service and CLI, the base restored the limit immediately at 91%. The candidate kept the top-up pending at 91%, 93%, and 99.4%, then restored it once at 100%. A separate below-full unplug fixture restored once after the existing debounce on the candidate; the base missed that transition. No physical battery, live desktop, or firmware was tested.
  • Unfiltered ./test/all in a read-only, headless namespace exited 1: 143 CLI checks passed; 9 of 300 shell files failed and 36 files reported skips. All nine failed again on the exact unchanged parent, with seven identical logs (including a restart-shell timeout with no output) and two matching after normalizing scratch names. The aggregate was not green. Current quattro has four intervening commits that do not touch the battery files or test entry points.

Screenshots

No visual layout change. This changes when one-time top-up ends, not how the panel renders.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge, with no new actionable issues found.

Summary

Keeps one-time battery top-ups active until the displayed percentage reaches 100% while plugged in.

  • One-time top-ups end at full charge or after a sustained unplug.

Reviews (2) · Last reviewed commit: "Test battery top-up restoration across u..." · Reviewed by Greptile

Comment thread test/shell.d/battery-test.sh Resolved
@omarchybot omarchybot added the bug Something isn't working label Dec 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Codex High traced the 91% failure in #21286 to the shell restoring the limit as soon as it sees UPower’s FullyCharged state. Opus 5.5 High and muse-wonder via pi at high effort agreed on that reading of the source, with review independence unverified. With the new cutoff, a gauge that stays below a displayed 100% keeps the top-up active while plugged in.

The committed tests cover the percentage rule. Please add a regression through the battery service that checks both a sustained unplug restoring the limit once and a reconnect within two seconds keeping top-up active. The private UPower fixture in #20879 is a starting point. Worker verification is still pending.

Drive the real battery service and charge-limit command on a private
UPower bus. Verify a short reconnect preserves the pending top-up and
two separate sustained unplugs each restore the limit once.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@omarchybot

Copy link
Copy Markdown
Collaborator

Recommend: Hold — waiting on maintainer-side worker verification of f460ee6.

The new regression exercises the real battery service and charge-limit command with synthetic UPower readings. It checks that a brief reconnect keeps the top-up pending and that a sustained unplug restores the limit once. GitHub’s test jobs passed. This run was limited to source review because the worker isolation check failed. Codex High, Opus 5.5 High and muse-wonder via pi, thinking high agreed on the debounce coverage. Review independence is unverified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants