feat(ios): usbmux runner route override + #1403 transport experiment evidence - #1510
Conversation
…evidence Adds AGENT_DEVICE_IOS_RUNNER_ROUTE=usbmux, an experimental override that routes coredevice-backend physical devices' runner commands through usbmux, and simplifies the xctest branch that awaited a no-op resolveRunnerTransport. Documents the live #1403 experiment (iPhone 17 Pro, USB + Wi-Fi legs): steady-state is a wash, but the >30s-idle tax drops from ~4.5s (tunnel re-probe + session re-establish) to ~440ms because the usbmux session stays hot; CoreDevice Wi-Fi devices never appear in usbmuxd, so the verdict is usbmux-primary with network fallback rather than tunnel-code deletion. Also records the cable-out failure gap (2x45s retry hang swallowing the usbmux DEVICE_NOT_FOUND hint), which affects today's xctest backend too.
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
|
Reviewed exact head [P2] The centralized route seam, direct/wait coverage, and live lifecycle/idle/Wi-Fi evidence otherwise support this groundwork. Multi-device/unpaired matrices remain follow-up risk for the implementation PR. Exact-head Coverage is also red from an unrelated Residual risk: no separately authorized cross-vendor review was performed. |
The env is re-read per resolve but from the daemon's environment, which is captured at daemon launch — a later CLI invocation cannot flip the route on a running daemon. Correct the source comment and experiment doc, and lock the read-point semantics with a regression test.
|
Clean review at The live USB/Wi-Fi evidence is credible and candid about remaining multi-device, failure-matrix, and immediate-fallback work for the later implementation PR. Exact-head CI is fully green, including Coverage and all platform smokes. Ready for human review. Residual risk: no separately authorized cross-vendor review was performed. |
|
Summary
Groundwork + live evidence for #1403 (usbmux as the primary physical-iOS runner transport). This PR does not implement the transport switch — it lands the experiment override, its tests, and the measured results that shape the implementation.
AGENT_DEVICE_IOS_RUNNER_ROUTE=usbmux: forces coredevice-backend physical devices' runner commands through the existing usbmux transport (read per-resolve inside the route resolver, the single choke point). Also simplifies the xctest branch that awaited a no-opresolveRunnerTransport.Key evidence (iPhone 17 Pro, iOS 26.5.2, same build, verified output)
DEVICE_NOT_FOUNDcable/trust hint. Implementation should make it non-retryable or trigger immediate network fallback.Follow-up (implementation PR)
One private route resolver: try usbmux first, fall back to the CoreDevice tunnel on usbmux
DEVICE_NOT_FOUND; tunnel cache code survives but only runs on the fallback path. Cabled devices then never pay the probe/TTL tax.Testing
sendRunnerCommandOnceandwaitForRunner;runner-transport.test.ts9/9.pnpm check:affected --run: green except 5 timeout-only failures inandroid-test-suite.test.ts(untouched by this change) which pass 7/7 in isolation — known contention flake signature.Closes nothing; informs #1403.