fix(agent): hand off capture across receiver routes - #1198
Open
justinechang39 wants to merge 1 commit into
Open
Conversation
Greptile SummaryThe PR coordinates HID++ capture teardown across receiver-route changes so firmware restoration follows the physical device’s latest route before a successor session arms.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/openlogi-agent-core/src/watchers/capture_session.rs | Generalizes capture-session stop signaling so teardown can carry route-handoff intent while preserving existing lifecycle semantics. |
| crates/openlogi-agent-core/src/watchers/gesture.rs | Sends handoff commands for receiver-route changes and retargets pending restoration retries through the latest per-device plan. |
| crates/openlogi-device/src/session/capture_restore.rs | Adds route-aware restoration and retains the elected route across retries while checking registry currency after writes. |
| crates/openlogi-device/src/session/gesture.rs | Accepts typed capture stop reasons and propagates handoff routes into firmware teardown. |
| crates/openlogi-agent-core/src/watchers/gesture/tests.rs | Updates lifecycle tests for typed stop commands and verifies route changes request firmware handoff. |
| crates/openlogi-device/src/session/gesture/tests.rs | Covers restoration through a successor route, delayed route publication, and rapid return to the original route. |
Sequence Diagram
sequenceDiagram
participant Plans as Capture plans
participant Manager as Gesture manager
participant Old as Retiring session
participant Registry as Channel registry
participant New as Successor route
Plans->>Manager: Publish same physical device on new route
Manager->>Old: CaptureSessionStop::Handoff(new route)
Old->>Registry: Look up new route
Registry-->>Old: Current shared channel
Old->>New: Restore native firmware reporting
Old-->>Manager: Done / pending restoration token
alt restoration completed
Manager->>New: Arm successor capture session
else restoration remains pending
Manager->>Registry: Retry via latest capture-plan route
Registry-->>Manager: Latest current channel
Manager->>New: Restore, then arm successor
end
Reviews (2): Last reviewed commit: "fix(agent): hand off capture across rece..." | Re-trigger Greptile
justinechang39
force-pushed
the
fix/multi-receiver-capture-route
branch
from
August 31, 2026 16:21
83e78f3 to
4844223
Compare
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
Fix HID++ button capture becoming stuck when one physical mouse moves between
receiver routes.
A retiring capture session now restores firmware state through the newly active
route before allowing its successor to arm. Pending restoration retries also
follow the latest route for the same physical device.
Changes
openlogi-device
openlogi-agent-core
No configuration or IPC wire-format changes.
Testing
macOS affected-package gate:
DEVELOPER_DIR=/Library/Developer/CommandLineTools RUSTFLAGS="-D warnings" cargo fmt --all -- --checkDEVELOPER_DIR=/Library/Developer/CommandLineTools RUSTFLAGS="-D warnings" cargo clippy -p openlogi-device -p openlogi-hid -p openlogi-agent-core -p openlogi-agent -p openlogi-cli -p openlogi --all-targets -- -D warningsDEVELOPER_DIR=/Library/Developer/CommandLineTools RUSTFLAGS="-D warnings" cargo test -p openlogi-device -p openlogi-hid -p openlogi-agent-core -p openlogi-agent -p openlogi-cli -p openlogiClean Linux full-workspace gate:
PATH="$HOME/.cargo/bin:$PATH" RUSTFLAGS="-D warnings" cargo fmt --all -- --checkPATH="$HOME/.cargo/bin:$PATH" RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets -- -D warningsPATH="$HOME/.cargo/bin:$PATH" RUSTFLAGS="-D warnings" cargo test --workspace --exclude openlogi-desktopPATH="$HOME/.cargo/bin:$PATH" RUSTFLAGS="-D warnings" RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay --exclude openlogi-agentPATH="$HOME/.cargo/bin:$PATH" RUSTFLAGS="-D warnings" cargo check -p openlogi-hidpp -p openlogi-device --target wasm32-unknown-unknownPATH="$HOME/.cargo/bin:$PATH" RUSTFLAGS="-D warnings" cargo check -p openlogi-core --no-default-features --target wasm32-unknown-unknownThe original failure was reproduced on an MX Master 4 with two Bolt receivers.
The patched app was not runtime-tested on hardware because no compatible full
Xcode/Metal toolchain is available for the test Mac's macOS 27 beta. Windows
checks were not run locally; CI covers that platform.
Fixes #1196