Same SP21+/SP22 login() drift as connect_to_device:
- 'TryOnlineChange' is gone from OnlineChangeOption
- login() now requires (OnlineChangeOption, bool) -- two positional
The fork hard-coded the old call shape; observed today on SP22 Patch 1
with the runtime up and the project compiled, every download_to_device
attempt failed with "login() takes exactly 2 arguments (0 given)".
Fix mirrors e862846 / eee8ce2:
- Probe OnlineChangeOption members at runtime (priority order tuned
for download: WithDownload / ForceDownload come first, since
'download' implies a write).
- Try (enum, False) / (enum, True) / (enum,) / bool / no-arg shapes.
- Add LOGIN_WAIT_SECONDS post-login state-stabilisation poll for the
credential dialog (default 60s, configurable 0-600).
- Tool-side IPC timeout = waitSec + 120s headroom for the actual
download work (download is heavier than connect, hence 120 vs 30).
The download itself is still done via the existing fall-through:
online_app.download() if exposed, else create_boot_application().
On SP22 the dir() shows source_download + create_boot_application (no
'download'), so the create_boot_application path is what runs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>