You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
viewer: input releases are lost when the injector drops its connection #407
Found in the release dry run 40751708690 for PR #400. The Rust gates failed in crates/pickforge-viewer/tests/inject_xvfb.rs > drop_releases_held_input: after the injector was dropped, Control_L (keycode 37) was still down, and sometimes the middle button too.
Injector::release_all in crates/pickforge-viewer/src/input.rs sends the XTEST releases and flushes. Drop then closes the connection. The X server can discard requests that a closed connection left unread, so the releases are lost and the keys stay down on the session display. The agent's next input then runs with a stuck modifier.
Reproduced locally: the injector suite on Xvfb, 60 runs with every CPU busy, failed 8 times in drop_releases_held_input. With a reply round trip after the releases, it failed 0 of 60 times there.
The same runs showed a test-only race in revoke_releases_held_input_and_stops_sending: the listener can query the key state before the server handles the injector's presses (2 of 60 runs).
Make release_all wait for a reply before it returns
Make the revoke test wait for the pressed state instead of asserting it at once
Fixed in #400: on drop, the injector arms a 1 s watchdog, releases held input, and waits for a reply. Not changed here: revoke, Return control, close and focus loss still release with a plain flush, as before. Like every other input call, that flush can block if the session server stops reading and the send queue fills.
Activity
fix(viewer): apply input releases before the injector closes its conn…
docs(release): note #407 and the final 0.7.1 gate run
ElbertePlinio commentedon Oct 28, 2026
Fixed in #400: on drop, the injector arms a 1 s watchdog, releases held input, and waits for a reply. Not changed here: revoke, Return control, close and focus loss still release with a plain flush, as before. Like every other input call, that flush can block if the session server stops reading and the send queue fills.