refactor(agent): consolidate capture manager slots - #1183
Open
AprilNEA wants to merge 1 commit into
Open
Conversation
Greptile SummaryThis PR consolidates each gesture and keyboard capture owner into a mutually exclusive running-or-recovering slot while preserving restoration and restart-pacing state.
Confidence Score: 5/5The PR appears safe to merge; no concrete regression was identified in capture ownership, restoration, restart pacing, or lifecycle suspension behavior. The consolidated slots preserve mutually exclusive running and recovery ownership, retain pending restoration and pacing facts together, reject stale completions, and resume deferred work through existing reconciliation triggers.
|
| Filename | Overview |
|---|---|
| crates/openlogi-agent-core/src/watchers/capture_session.rs | Introduces the shared running/recovering slot state machine and rejects stale or duplicate completions without displacing authoritative state. |
| crates/openlogi-agent-core/src/watchers/gesture.rs | Consolidates gesture sessions, pending restores, and restart deadlines by physical device while retaining retry, dispatch, and lifecycle gating behavior. |
| crates/openlogi-agent-core/src/watchers/keyboard.rs | Consolidates keyboard ownership and recovery state while preserving lease handoff, restoration retries, and restart pacing. |
| crates/openlogi-agent-core/src/watchers/gesture/tests.rs | Updates gesture tests to exercise slot-based planned and unexpected completion pacing plus suspended deadlines. |
| crates/openlogi-agent-core/src/watchers/keyboard/tests.rs | Updates keyboard deadline coverage for the consolidated recovery slot. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Running capture slot] -->|matching planned completion| B[Recovering slot]
A -->|matching unexpected completion| C[Recovering with restart pacing]
A -->|stale completion| A
B -->|restore still pending| B
B -->|restore complete and successor wanted| A
C -->|restore pending| C
C -->|deadline elapsed and restore complete| A
B -->|recovery empty and no successor| D[No slot]
C -->|plan removed and recovery empty| D
Reviews (1): Last reviewed commit: "refactor(agent): consolidate capture man..." | Re-trigger Greptile
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
Consolidate each gesture/keyboard capture owner into one runtime slot so a running capture epoch cannot coexist with post-session recovery state. This is an ownership-state refactor only; HID behavior, ordered input draining, and recovery policy remain unchanged.
Changes
CaptureSlotwith mutually exclusive running and recovering variants while retaining pending firmware restore and restart pacing as independent recovery factsTesting
cargo test -p openlogi-agent-core capture_session::tests— 6 passedcargo test -p openlogi-agent-core watchers::gesture::tests— 13 passedcargo test -p openlogi-agent-core watchers::keyboard::tests— 5 passedcargo test -p openlogi-agent-core— 221 passedRUSTFLAGS="-D warnings" cargo fmt --all -- --check— passedRUSTFLAGS="-D warnings" cargo clippy -p openlogi-agent-core -p openlogi-agent --all-targets -- -D warnings— passedRUSTFLAGS="-D warnings" cargo test -p openlogi-agent-core -p openlogi-agent— 254 tests passed (221 agent-core, 33 agent binaries); doc-tests passedNo linked issue.