Repository navigation
fix(agent-core): name low-battery notices by the persisted product name - #2659
Open
HumanMus1c wants to merge 1 commit into
Open
HumanMus1c wants to merge 1 commit into
HumanMus1c wants to merge 1 commit into
Conversation
[Low impact] The PR appears safe to merge; the previous test finding is fully addressed.
|
HumanMus1c
force-pushed
the
fix/agent-low-battery-product-name
branch
from
November 26, 2026 14:10
5009d96 to
ea9bfbe
Compare
This branch has not been deployed
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.
Summary
Low-battery notices previously fell straight back to the prettified firmware codename whenever a device had no user-assigned custom name, ignoring the curated product
display_namepersisted inconfig.toml.This aligns
NoticeKind::LowBatterywith the GUI and tray display-name precedence: user custom name first, then persisted productdisplay_name, then prettified firmware codename.Changes
openlogi-agent-core:crates/openlogi-agent-core/src/orchestrator.rs: Fall back to a non-empty trimmedself.config.device_identity(&device.config_key)display_namebeforedevice.codenamewhen postingNoticeKind::LowBattery.crates/openlogi-agent-core/src/orchestrator/tests/low_battery.rs: Addthe_notice_prefers_the_persisted_product_nameunit test.Testing
cargo fmt --all -- --check,cargo clippy -p openlogi-agent-core --all-targets -- -D warnings, andcargo test -p openlogi-agent-core(899 passed, 0 failed) on Windows (x86_64-pc-windows-msvc), plus fullcargo xtask cion Windows and Linux (Ubuntu/WSL) on the combined branch.self.config.device_identity(&device.config_key)fallback incrates/openlogi-agent-core/src/orchestrator.rscausesthe_notice_prefers_the_persisted_product_nameto fail (assertion left == right failed, receivingSome("Synthetic Performance Mouse")instead ofSome("MX Master 3S")).display_nameinconfig.tomland no custom rename, trigger a low-battery notice (e.g., via mock consolebattery 1 5or a discharging device at <= 20%) and verify the notice shows the persisted product name instead of the firmware codename.