UI-WINDOWS-INPUT-DEADLINE: Honor the Windows console input deadline #447
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!447
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/windows-console-input-deadline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: UI-WINDOWS-INPUT-DEADLINE
What and why
After discarding a mouse move or another non-key record, the Windows build console reused the full input timeout. In a 100 ms wait, a mouse move at 90 ms let the same call consume a key arriving at 150 ms. Each wait now uses the time remaining until a single monotonic deadline. Zero-timeout reads still poll without blocking.
Tested
Windows 11 25H2 (26200.9974), Ryzen 9 8945HX, Python 3.13.7.
mainby returning the late key. With the patch, the first read times out within Win32 millisecond granularity, and a subsequent zero-timeout poll retrieves the key.python -IB tests/test_leonida_tui.pypassed 25 tests.python -IB tests/test_make_game_argparse.pypassed 38 tests.python -IB tests/test_text_write_line_endings.pypassed 3 tests.python -IB scripts/check_no_game_data.pyalso passed.GPUs tested: n/a. The test simulates Win32 events and runs on the CPU.
AI-assisted: Yes, OpenAI Codex helped reproduce, fix, and test the issue.
Checklist
main.Merging. Why merged: the Windows console input wait now honours its deadline instead of restarting the full wait after a discarded record (e.g. a mouse-move event).
Why it's good: security-reviewed (local tool change only). Tested on Windows 11 merged onto main 8f481cf: tests/test_leonida_tui.py 24 passed on main -> 25 passed with this PR; the new test fails on main and passes with the fix; compileall clean.
AI-assisted (Claude Code, Claude Opus 5.5).