Skip to content

fix(agent-core): name low-battery notices by the persisted product name - #2659

Open
HumanMus1c wants to merge 1 commit into
AprilNEA:masterfrom
HumanMus1c:fix/agent-low-battery-product-name
Open

HumanMus1c wants to merge 1 commit into
AprilNEA:masterfrom
HumanMus1c:fix/agent-low-battery-product-name

Conversation

@HumanMus1c

@HumanMus1c HumanMus1c commented Nov 26, 2026 •

Copy link
Copy Markdown

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_name persisted in config.toml.

This aligns NoticeKind::LowBattery with the GUI and tray display-name precedence: user custom name first, then persisted product display_name, then prettified firmware codename.

PR 2/12 — Part of a 12-PR series introducing a floating device-battery indicator (Flow Indicator HUD) and tray battery readout for Windows 11 and Linux (including WSL). Each PR in the series is kept small and focused; this PR is a standalone fix and can be reviewed and merged independently.

Changes

  • openlogi-agent-core:
    • crates/openlogi-agent-core/src/orchestrator.rs: Fall back to a non-empty trimmed self.config.device_identity(&device.config_key) display_name before device.codename when posting NoticeKind::LowBattery.
    • crates/openlogi-agent-core/src/orchestrator/tests/low_battery.rs: Add the_notice_prefers_the_persisted_product_name unit test.

Testing

  • Verified with cargo fmt --all -- --check, cargo clippy -p openlogi-agent-core --all-targets -- -D warnings, and cargo test -p openlogi-agent-core (899 passed, 0 failed) on Windows (x86_64-pc-windows-msvc), plus full cargo xtask ci on Windows and Linux (Ubuntu/WSL) on the combined branch.
  • Regression counter-proof: Temporarily removing the self.config.device_identity(&device.config_key) fallback in crates/openlogi-agent-core/src/orchestrator.rs causes the_notice_prefers_the_persisted_product_name to fail (assertion left == right failed, receiving Some("Synthetic Performance Mouse") instead of Some("MX Master 3S")).
  • Runtime / hardware verification: Not separately runtime-tested on hardware as a standalone commit (verified via unit test and full branch testing on Windows 11 / Ubuntu WSL).
  • How to verify manually: With a device that has a persisted product display_name in config.toml and no custom rename, trigger a low-battery notice (e.g., via mock console battery 1 5 or a discharging device at <= 20%) and verify the notice shows the persisted product name instead of the firmware codename.

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; the previous test finding is fully addressed.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the previous test finding is fully addressed.

Summary

Low-battery notices now prefer the saved product name when no custom name exists, before falling back to the firmware codename.

  • Low-battery notices use saved product names when no custom name is set.

Reviews (2) · Last reviewed commit: "fix(agent-core): name low-battery notice..." · Reviewed by Greptile

@HumanMus1c
HumanMus1c force-pushed the fix/agent-low-battery-product-name branch from 5009d96 to ea9bfbe Compare November 26, 2026 14:10

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant