fix(agent): reapply volatile settings after macOS resume - #506
Merged
davidbudnick merged 1 commit intoAug 10, 2026
Conversation
Greptile SummaryThe PR adds native macOS resume detection and replays volatile device settings at the next inventory refresh.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/openlogi-agent/Cargo.toml | Enables the NSWorkspace and NSNotification bindings needed by the macOS observer implementation. |
| crates/openlogi-agent/src/main.rs | Shares a coalesced resume flag with AppKit and consumes it immediately before an inventory refresh. |
| crates/openlogi-agent/src/tray.rs | Adds process-lifetime workspace notification observers and regression coverage for forwarding and coalescing. |
Sequence Diagram
sequenceDiagram
participant macOS as macOS Workspace
participant AppKit as AppKit ResumeTarget
participant Flag as Atomic resume_pending
participant Core as Agent select loop
participant Orch as Orchestrator
participant Device as Online devices
macOS->>AppKit: Wake/display/session notification
AppKit->>Flag: store(true)
Core->>Core: Receive inventory snapshot
Core->>Flag: swap(false)
Core->>Orch: reapply_volatile_on_next_refresh()
Core->>Orch: refresh_inventory(snapshot)
Orch->>Device: Replay volatile settings
Reviews (2): Last reviewed commit: "fix(agent): reapply volatile settings af..." | Re-trigger Greptile
davidbudnick
force-pushed
the
fix/macos-resume-reapply
branch
from
August 10, 2026 03:19
4a850f7 to
99714ac
Compare
davidbudnick
added a commit
to davidbudnick/OpenLogi
that referenced
this pull request
Aug 16, 2026
DPI, SmartShift, wheel mode, and lighting live in device RAM and clear when devices power-cycle across a system sleep, but the first post-wake inventory snapshot can look identical to the last pre-sleep one, so the per-device reapply triggers never fire. macOS got a native resume hook (AprilNEA#506); Windows still relied on the inventory watcher's >1-minute polling-gap heuristic, which misses most sleep/hibernate wakes (AprilNEA#527, and the wake-from-sleep reports in AprilNEA#393). - resume_windows.rs: RegisterSuspendResumeNotification with DEVICE_NOTIFY_CALLBACK sets the shared resume flag on PBT_APMRESUMEAUTOMATIC / PBT_APMRESUMESUSPEND — no message pump needed, and independent of the tray preference (the tray window only exists when show_in_menu_bar is on). - main.rs: the core consumes the coalesced flag at the same seam the macOS observer feeds and replays volatile settings on the next inventory snapshot. - orchestrator: wake-flagged reapply targets now get the same bounded confirm-retry run as first sightings — post-wake, a receiver can enumerate while its mouse link is still re-establishing, so a one-shot write can time out just like the cold-boot race (AprilNEA#449). Fixes AprilNEA#527
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
Orchestrator::reapply_volatile_on_next_refresh().Why
The portable inventory watcher infers a wake only from a polling gap longer than one minute. Short system sleeps, display wakes, and session reactivation can therefore leave firmware-native reverse scroll and SmartShift settings reset even though the device remains online.
The AppKit callback only sets an atomic flag; it performs no HID I/O. The next inventory snapshot runs the existing replay path for online devices, so this adds no timer or second settings implementation.
Addresses #405.
This does not re-arm programmable-control capture. #348 and #450 cover that separate capture/diversion recovery path.
Testing
cargo fmt --all -- --checkcargo clippy -p openlogi-agent --all-targets --locked -- -D warningscargo test -p openlogi-agent --all-targets --locked(11 passed, including all three workspace notifications and burst coalescing)cargo clippy --workspace --all-targets --exclude openlogi-gui --locked -- -D warningscargo test --workspace --exclude openlogi-gui --locked(471 passed, 1 ignored)cargo check -p openlogi-agent --all-targets --locked --target x86_64-unknown-linux-gnucargo check -p openlogi-agent --all-targets --locked --target x86_64-pc-windows-msvcFull local workspace Clippy reached
gpui_macosbut could not compile its Metal shader because the local Xcode beta installation reports a missing Metal Toolchain. GitHub CI is left to provide the complete GUI-inclusive macOS gate.