Repository navigation
fix(mobile): boot one simulator when nothing is booted and no device is named - #1433
KrzysztofMoch wants to merge 2 commits into
Conversation
…is named With no device and nothing booted, the pool bound an empty slot and agent-device's unscoped boot failed with AMBIGUOUS_MATCH on any machine with more than one simulator. The pool now picks one shut-down simulator or emulator itself (phone before tablet, newest OS, name, id), binds a simulator by UDID and an AVD by name, and logs the pick. Device labels read `name (id)` when a binding has both. Fixes ENG-1037
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
Thanks, the AMBIGUOUS_MATCH cause is right and the iOS half is solid. On iOS the pick uses the structured fields agent-device gives ( Reproduced on main with agent-device 0.21.33 using a private simulator set and its own state dir (iPhone 17 Pro, iPhone 17, iPhone 16e, iPad Pro, all shut down): Must fix
Nits
For the maintainer agent-device already ranks unscoped selection (iPhone < iPad < TV < desktop, emulators before physical) and then deliberately throws on ties. This PR copies that ranking into e2e and adds tie-breaks. Alternative: an upstream agent-device option to break ties itself (newest OS, then name, then id) on an unscoped local boot, which fixes every agent-device user and leaves e2e passing This was an automated review. |
Drop the AVD name filter: a shut-down AVD is skipped only when agent-device reports it as a TV. Keep cold-pick policy beside the ranking, skip a shut-down device another session holds, and say the Android pick is name order.
🟢 e2e ios: 1 flaky, 54 passed, 1 skipped
|
| Test | Time | |
|---|---|---|
| tests/flows-lists.e2e.ts · 1 flaky, 6 passed | 3m 8s | |
| 🟢 | infinite scroll reaches the target item | 23.6s |
| 🟢 | product catalog adds exactly two of the right variant | 10.1s |
| 🟢 | gestures: long-press, then swipe left | 8.9s |
| sticky chrome: accept below the fold, then continue (1 failed attempt first) | 9.9s | |
| 🟢 | async states: load, pull to refresh, claim through the toast | 13.7s |
| 🟢 | huge virtualized list reaches row 512 | 1m 50s |
| 🟢 | web view coupon form applies the code shown on the page | 11.8s |
| ⏭️ | tests/controls.e2e.ts · 23 passed, 1 skipped | 2m 57s |
| 🟢 | control inventory › a label query resolves a labeled text field | 13.6s |
| 🟢 | control inventory › a labeled field answers name, display value, value reads, fill, and clear | 16.4s |
| 🟢 | control inventory › a placeholder query and attribute reads find the field | 4.5s |
| 🟢 | control inventory › a secure field takes a fill and denies value reads | 8.0s |
| 🟢 | control inventory › press sends a character and Enter through the soft keyboard | 9.9s |
| 🟢 | control inventory › a field autofocuses on mount and focus() moves the focus | 10.1s |
| 🟢 | control inventory › toBeFocused follows the focus | 8.6s |
| 🟢 | control inventory › a switch checks, unchecks, and reports its state | 9.5s |
| 🟢 | control inventory › checkbox and radio roles answer getByRole, and a checkbox toggles by tap | 8.2s |
| 🟢 | control inventory › checkbox and radio roles check, uncheck, and report their state | 12.4s |
| 🟢 | control inventory › a radio group reports the checked option | 8.5s |
| 🟢 | control inventory › buttons report disabled, enabled, and a state that arrives later | 7.8s |
| 🟢 | control inventory › a display: none element is absent rather than hidden, its visible twin attached | 7.2s |
| 🟢 | control inventory › a header answers its accessible name | 4.2s |
| 🟢 | control inventory › a tab row answers count, all, texts, filters, positions, and switching | 6.2s |
| 🟢 | control inventory › a list answers counts, list-form text, reads, and boxes in order | 6.7s |
| ⏭️ | control inventory › a row contains its texts (skipped: React Native flattens a plain View out of the accessibility tree on both platforms: XCTest and the Android helper report a View with a testID as a leaf beside its children, so filter({ has }) and a query scoped to it match nothing; only Sc…) | |
| 🟢 | control inventory › a long press lands as one | 8.1s |
| 🟢 | control inventory › pointer verbs land at the point asked for | 9.7s |
| 🟢 | control inventory › an ambiguous locator fails at once | 5.5s |
| 🟢 | control inventory › screenshot, restart, and clearState reopen the app on its home list | 10.3s |
| 🟢 | refusals › verbs a device never declares are refused before the engine | 2ms |
| 🟢 | refusals › keys the soft keyboard cannot send are refused by the engine | 621ms |
| 🟢 | refusals › a missing locator fails as not found once its timeout passes | 1.1s |
| 🟢 | tests/device-fixture.e2e.ts · 11 passed | 1m 33s |
| 🟢 | device fixture › setAppearance flips the color scheme the app reads | 14.2s |
| 🟢 | device fixture › setOrientation rotates the window the app measures | 12.1s |
| 🟢 | device fixture › the clipboard reads back what was written | 6.1s |
| 🟢 | device fixture › home leaves the app, openApp brings it back where it was | 6.3s |
| 🟢 | device fixture › closeApp then openApp relaunches on the home list | 7.8s |
| 🟢 | device fixture › closeApp leaves the next commands on the same device | 10.8s |
| 🟢 | device fixture › foregroundApp after closeApp reports the closed session as APP_NOT_OPEN | 5.4s |
| 🟢 | device fixture › device.back pops the scenario | 5.9s |
| 🟢 | device fixture › unstable_raw reaches the test session through agent-device | 4.4s |
| 🟢 | device fixture › setLocation and clearLocation change what the app reads | 10.2s |
| 🟢 | device fixture › enrollBiometrics and setBiometrics answer a biometric prompt | 9.9s |
| 🟢 | tests/device.e2e.ts · 3 passed | 1m 5s |
| 🟢 | sequential onboarding echoes the exact values | 40.5s |
| 🟢 | onboarding rejects a malformed email before advancing | 13.5s |
| 🟢 | dismissing the keyboard over choice controls leaves them as they were | 11.1s |
| 🟢 | tests/flows.e2e.ts · 7 passed | 1m 8s |
| 🟢 | text inputs unlock the submit button | 13.0s |
| 🟢 | filled text inputs report their values | 10.0s |
| 🟢 | modal flow confirms through the native alert | 9.6s |
| 🟢 | bottom tabs act inside the last tab | 7.3s |
| 🟢 | error recovery retries, then confirms the delete | 9.4s |
| 🟢 | choice controls place the exact order | 7.6s |
| 🟢 | debounced search selects the target once results arrive | 11.2s |
| 🟢 | tests/login-form.e2e.ts · 3 passed | 49.4s |
| 🟢 | login form › rejects a malformed email | 13.6s |
| 🟢 | login form › rejects an unknown account | 13.7s |
| 🟢 | login form › signs in and logs out | 22.1s |
| 🟢 | tests/smoke.e2e.ts · 1 passed | 7.3s |
| 🟢 | home lists the scenarios and opens one | 7.3s |
e2e 0.21.3 · 6m 2s · ios-simulator · run artifacts
🟢 e2e ios agent: 1 flaky, 20 passed, 1 skipped25 agent steps · 6 replayed from cache · 69 model calls · 463.8k tokens (81% cached) · $0.0338
|
| Test | Agent | Time | |
|---|---|---|---|
| tests-agent/scenarios.e2e.ts · 1 flaky, 20 passed, 1 skipped | 25 steps · 69 calls | 11m 45s | |
| 🟢 | act completes Login Form | 1 step | 37.9s |
| 🟢 | act completes Infinite Scroll List | 1 step · 1 call | 42.2s |
| 🟢 | act completes Modal Flow | 1 step · 1 call | 26.3s |
| 🟢 | act completes Bottom Tabs | 1 step · 1 call | 23.9s |
| 🟢 | act completes Text Input Variations | 1 step · 3 calls | 34.9s |
| 🟢 | act completes Broken Accessibility | 2 steps · 7 calls | 54.7s |
| 🟢 | act completes Vision Only | 2 steps · 6 calls | 32.7s |
| act completes Gestures (1 failed attempt first) | 1 step · 9 calls | 45.9s | |
| 🟢 | act completes Async States | 1 step · 9 calls | 38.5s |
| 🟢 | act completes Debounced Search | 1 step · 1 call | 28.7s |
| 🟢 | act completes Flattened Registration Form | 2 steps · 1 call | 28.8s |
| 🟢 | act completes Flattened Login | 2 steps · 10 calls | 1m 11s |
| 🟢 | act completes Sticky Chrome Target | 1 step · 2 calls | 56.1s |
| 🟢 | act completes WebView Accessibility | 1 step | 12.1s |
| 🟢 | act completes Permission Prompt | 1 step | 10.9s |
| 🟢 | act completes Photo Picker | 1 step · 2 calls | 31.1s |
| 🟢 | act completes Product Catalog | 1 step | 10.0s |
| 🟢 | act completes Error Recovery | 1 step | 9.4s |
| 🟢 | act completes Choice Controls | 1 step · 5 calls | 38.7s |
| 🟢 | act completes Stripe PaymentSheet | 1 step · 10 calls | 38.4s |
| 🟢 | act completes Apple Pay | 1 step · 1 call | 33.0s |
| ⏭️ | act completes Apple Pay Billing Address (skipped: the CI simulator's Apple Pay sheet skips the billing-address step, so the scenario cannot be completed there) |
e2e 0.21.3 · 12m 57s · ios-simulator · run artifacts
|
[claude-opus-5-5] responding on behalf of krzysztof Thanks. All in b0a163f:
On e2e vs agent-device: an upstream tie-break would fix every agent-device user, and e2e could then go back to passing |
🟢 e2e android: 57 passed, 1 skippedAll 58 tests in 7 files
e2e 0.21.3 · 8m 19s · android-emulator · run artifacts |
🟢 e2e android agent: 1 flaky, 19 passed24 agent steps · 15 replayed from cache · 40 model calls · 266.8k tokens (84% cached) · $0.0176
|
| Test | Agent | Time | |
|---|---|---|---|
| tests-agent/scenarios.e2e.ts · 1 flaky, 19 passed | 24 steps · 40 calls | 7m 51s | |
| 🟢 | act completes Login Form | 1 step | 42.9s |
| 🟢 | act completes Infinite Scroll List | 1 step | 40.0s |
| 🟢 | act completes Modal Flow | 1 step | 16.6s |
| 🟢 | act completes Bottom Tabs | 1 step | 11.0s |
| 🟢 | act completes Text Input Variations | 1 step | 12.0s |
| 🟢 | act completes Broken Accessibility | 2 steps · 5 calls | 26.2s |
| 🟢 | act completes Vision Only | 2 steps · 1 call | 12.6s |
| act completes Gestures (1 failed attempt first) | 1 step · 11 calls | 43.8s | |
| 🟢 | act completes Async States | 1 step · 11 calls | 47.0s |
| 🟢 | act completes Debounced Search | 1 step | 8.6s |
| 🟢 | act completes Huge Virtualized List | 1 step | 1m 21s |
| 🟢 | act completes Flattened Registration Form | 2 steps · 1 call | 11.3s |
| 🟢 | act completes Flattened Login | 2 steps · 6 calls | 27.3s |
| 🟢 | act completes Sticky Chrome Target | 1 step | 10.3s |
| 🟢 | act completes WebView Accessibility | 1 step · 5 calls | 21.7s |
| 🟢 | act completes Permission Prompt | 1 step | 9.3s |
| 🟢 | act completes Product Catalog | 1 step | 13.1s |
| 🟢 | act completes Error Recovery | 1 step | 11.3s |
| 🟢 | act completes Choice Controls | 1 step | 11.9s |
| 🟢 | act completes Sequential Onboarding | 1 step | 13.3s |
e2e 0.21.3 · 8m 32s · android-emulator · run artifacts
|
[claude-opus-5-5] responding on behalf of krzysztof Ready for review. Two decisions left for a human:
Not verified on a real Android emulator; the iOS path was run on a Mac (see Verified). |
|
[claude-opus-5-5] responding on behalf of krzysztof Closing: the fix goes upstream to agent-device instead, so its unscoped boot picks one device rather than failing with "N devices match this request equally". |
An iOS target with no
device, on a machine where no simulator is booted, failse2e runinprepare:The
e2e initiOS preset writesmobile({ platform: 'ios' }), so the first run of a fresh project hits this on most Macs. Android hits it too once two AVDs exist and none is running.Issue
Fixes ENG-1037
Cause
With nothing booted, the pool bound one empty slot (
{}), sowarmand the worker'sinitcalleddevices.boot({ platform: 'ios' }). agent-device 0.21.33 ranks every shut-down iPhone simulator the same and throwsAMBIGUOUS_MATCH.Fix
BootedDevicesinpackages/mobile/src/pool.tsnow reads the whole inventory. When nothing is booted,coldPickchooses one shut-down simulator or emulator no other agent-device session holds, ranked by:formFactor: 'phone' | 'tablet')kind,target,appleOs,osVersion) decide: TV and visionOS simulators, AVDs it reports astv, and physical devices are never picked. It lists a shut-down AVD with no form factor or OS version, so on Android the pick is the first AVD by name.deviceLabelreadsname (id)when a binding has both, and booted devices now carry their name. Progress lines, error text, and the report's device showiPhone 17 (948FF738-…)instead of a bare UDID.A device name alone is still not unique across iOS runtimes: agent-device takes the first match. A UDID remains the way to pin one.
Verified
Ran it locally: yes
AGENT_DEVICE_IOS_SIMULATOR_DEVICE_SET) holding iPhone 17 Pro, iPhone 17, and iPad Pro 13-inch (M5) on iOS 26.5, all shut down. Nothing else on the machine was touched.apps/mobile-benchmark,E2E_MOBILE_BENCHMARK_IOS_DEVICEunset (nodevice), Release build from.github/actions/expo-app,e2e run tests/smoke.e2e.ts --target ios-simulator.pool.tsrebuilt in.no booted ios device; agent-device boots oneno booted ios device; picked iPhone 17 (26.5). Name another in the target'sdeviceoption, or boot one firstENGINE_FAILURE (launch) boot failed: 2 devices match this request equally; select one explicitly.booting iPhone 17 (1F5AAED4-5302-4A25-AFEF-C49DA590E829) (1 of 1)home lists the scenarios and opens onepassed, exit 0; only iPhone 17 bootedOn main the error says 2, not 3: agent-device already ranks the iPad below the two tied iPhones.
Not run on a real Android emulator; the Android pick (bind by AVD name, skip an AVD reported as a TV) is covered by
tests/unit/engine.test.ts. Skipping a shut-down simulator another session holds is covered there too, not on a device.Made with Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, running inside T3 Code.