- Diagnose and fix the reproduced Chrome-to-Notepad switch failure.
- From Chrome foreground:
App.switch("Calculator")passedApp.switch("Notepad")failed
- That narrowed the issue from a generic browser-to-desktop switch failure to a more specific focus-path defect.
- Added
research/experiments/switch_focus_diagnose.py - Sequential runs showed:
- with Chrome foreground and Notepad target, the foreground remained Chrome for the full observation window
- the Win32 path completed without exception, so the old code never entered the fallback focus path
bring_window_to_top()only used_focus_window_fallback()on exceptions.- It did not fall back when the Win32 path returned cleanly but still failed to move the actual foreground.
bring_window_to_top()now calls_focus_window_fallback()wheneverGetForegroundWindow()still does not equal the target after the Win32 path completes.
tests/test_app_service.py- pass
- full suite
183 passed in 5.58s
- reloaded the hot worker with
DevServer(mode="reload") - reran the exact Chrome-to-Notepad path
App.switch("Notepad")- pass
- follow-up
Snapshot- pass
- foreground window was
*wmcp-type-probe-1773117083.txt - Notepad
- A first attempt to compare Notepad and Calculator probes in parallel was invalid because both manipulated the same shared desktop state.
- UI-state-changing experiments must be run sequentially.