fix: recover keyboard key state after pause-point interruption with ReleaseAll#1965
Conversation
…eleaseAll Pause-point hits during Press left ButtonControl wasPressedThisFrame latches and queued applies able to look like a re-press after resume, and bookkeeping could diverge from the device. Discard pending applies on pause, sync press latches on cleanup, add paused-tolerant ReleaseAll, and extend the harness with quick-resume and long-pause recovery scenarios. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (14)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Keep pause-point captures intact during ReleaseAll, limit ForceSync to stale isPressed latches, and tighten the harness so quick-resume timing is measured from interrupt and paused ReleaseAll preserves TryGetCapturedValue. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
simulate-keyboard Press: discard pending Input System apply subscriptions on pause, and syncButtonControlwasPressedThisFramelatches on cleanup so a quick resume cannot look like a re-press.ReleaseAll(device + bookkeeping) withReleasedKeysin the response, and expose it indefault-tools.json(no protocol bump; release-input stamps refreshed).scripts/regression-harness-key-state-after-pause-interruption.shwith two Green scenarios: resume within 3s must not re-press, and >6s pause →ReleaseAll→ freshPresssucceeds.User Impact
After a pause-point hits during keyboard simulation, agents can recover stuck key state with
ReleaseAll(even while still paused), and a fast resume no longer silently re-applies a discarded press edge.Test plan
KeyboardKeyStateServiceTests(ClearTrackedKeys bookkeeping)KeyboardInputSimulationResponseFactoryTests(Interrupted message includesqueued input edge was discarded)uloop compile0 errorsscripts/check-go-cli.shexit 0scripts/regression-harness-key-state-after-pause-interruption.shexit 0 (scenarios 1–3)Evidence notes
PressEdgeKeyAlreadyPressedBeforeQueue=truewith KeyUpKeyStateTrackedHeld=false(device vs bookkeeping divergence).devicePressed=True/ stickyIsSpaceHeldwithout new CLI input; root cause was a stalem_LastUpdateWasPresslatch afterwasPressedThisFramemonitoring, plus pending-apply discard on pause. Post-fix harness scenario 2 is Green.