Skip to content

fix(windows): resolve posix assumptions in doctor checks - #97

Open
owlze wants to merge 1 commit into
CodeAbra:mainfrom
owlze:feature/windows-doctor-fixes
Open

fix(windows): resolve posix assumptions in doctor checks#97
owlze wants to merge 1 commit into
CodeAbra:mainfrom
owlze:feature/windows-doctor-fixes

Conversation

@owlze

@owlze owlze commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This PR fixes [WARN] (q) and [WARN] (n) false positives when running iai-mcp doctor on Windows.

  • Implements a native Windows fallback using GetLastInputInfo (via ctypes.windll.user32) for HID idle time detection.
  • Updates the CLI reachability check to find iai.exe when it's not directly in the system PATH but located next to sys.executable.

@CodeAbra

CodeAbra commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Windows part reads right to me — the iai.exe fallback next to sys.executable and the GetLastInputInfo probe with the tick-count wraparound both look correct. Windows stays yours.

One thing to put back before I merge. The logind branch got rewritten too, and it isn't part of the Windows fix:

        if "logind" in status.available_signals:
            detail = (
                f"logind IdleHint: {idle_str('not idle')}, available: {signals_str}"
            )
            return detail, "PASS"

tests/test_doctor.py::test_doctor_row_n_hid_idle_source_linux_logind asserts that exact string — I ran your branch on mac and got 1 failed, 51 passed on it. And not idle is the accurate label in that branch: logind answered and the user is active, so unavailable says the opposite of what happened.

Your new Windows branch below it is fine as written, no change needed there.

Small thing while you're in the file: lines 214 and 220 have trailing whitespace.

Note on platform: we develop on mac, so nothing Windows here gets verified on our side — your test on a real Windows box is the check that counts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants