fix(android): fail doctor when adb is the Windows binary on a POSIX host

Merged
OK
2mo ago
+182-8

Summary

From e2e feedback: under WSL with a Windows adb.exe on PATH (e.g. ANDROID_HOME under /mnt/c), adb version succeeds, so doctor passed, but recordings, pulls, and installs failed because adb resolves host paths as Windows paths.

agent-device doctor now reads adb's Installed as line and fails the Android toolchain check with reason android_adb_windows_binary_on_posix_host (plus adbPath evidence and a Linux platform-tools hint) when a non-Windows host gets a drive-letter or UNC path. The host platform is injected from the root composition, keeping platform-android free of ambient process authority. Known-limitations docs gain a WSL note.

5 files touched.

Validation

Tested commit: dbc01611fa4da0fa776f2ed4a48dda0b1b7fd1ae (on upstream/main 9a245d0ef).

  • pnpm vitest run packages/platform-android/src/__tests__/doctor.test.ts: 7 passed (Windows adb on linux fails with typed reason; Linux adb under WSL passes; Windows adb on win32 passes)
  • pnpm check:affected --run --base upstream/main: all runnable checks passed (370 files / 2402 related tests). First run caught a layering violation (process.platform in platform-android), fixed by injecting the platform.

Risks: no WSL host available, so validation is unit-level only. This adds the diagnosis; recording with a Windows adb is still unsupported.