fix(limrun): let tests run on Limrun devices again
What and why
-
Every
limrun()lease failed seconds after Limrun created the device, so no test ore2e mcpsession could run on one (@e2e-dev/limrun0.2.4 with@e2e-dev/mobile0.12.6):ENGINE_FAILURE: device provider "Limrun" could not lease a device: returned a lease without an id and a daemon baseUrl or JSON client configuration (no `session` or daemon keys) while preparing engine mobile for target "ios" -
#1513 put the agent-device
sessionon the lease'sclient, so the install and heartbeat clients that reuse that object would name one. The mobile engine reserves that key (RESERVED_CLIENT_KEYSinpackages/mobile/src/bindings.ts) and rejects a lease that sets it. -
The driver now leaves
sessionoff theclientit returns. Its allocate and install clients and the heartbeat add it themselves fromleaseSession(stateDir), the waypackages/mobile/src/lease/does. -
DriverBinding.clientis typed asDeviceClientConfig, so asessionin that literal no longer compiles. -
leaseSessionis a local copy of mobile's five lines.@e2e-dev/mobile/leasedoes not export it, and exporting it would raise Limrun's peer floor on mobile. -
The driver unit test asserted that
sessionwas on the binding. It now asserts the exact client the engine receives, and fails on main.
Issue
No e2e issue. This is a regression from #1513, found on 2026-11-10 with the published packages.
Verified
Ran it locally: yes
- A scratch project on the built packages, against a real Limrun iOS simulator. The target is
mobile({ platform: 'ios', device: limrun({ hardTimeout: '15m' }) })withapp: { bundleId: 'com.apple.mobilesafari' }, run withe2e run tests/safari.e2e.ts --video. The test opens Safari, openshttps://example.com, closes Safari's first-launch tip, and expects the page text.
| main | this branch |
|---|---|
| Lease rejected, no test executed, exit 3 | Lease accepted, 1 test passed, exit 0 |
| no device to show |
main:
ℹ leasing 1 ios device(s) from Limrun
ℹ Limrun (1 of 1): created ios_euna_01m723ptnafjqaby9advh0rnmp
ℹ Limrun: released 1 device(s)
ERROR infrastructure error ENGINE_FAILURE (launch)
device provider "Limrun" could not lease a device: returned a lease without an id and a daemon baseUrl or JSON client configuration (no `session` or daemon keys) while preparing engine mobile for target "ios"
Test Files no test files
Tests no tests executed
Errors 1 error
this branch:
ℹ leasing 1 ios device(s) from Limrun
ℹ Limrun (1 of 1): created ios_euna_01m724he11fya8hmab1bjqgwm3
ℹ Limrun: leased ios_euna_01m724he11fya8hmab1bjqgwm3
ℹ booting limrun:ios:1e6bf23c551b5a69ed8fbb04f9baeb0f (1 of 1)
✓ mobile engine for target "ios" prepared 1.42s
✓ |ios| tests/safari.e2e.ts > Safari opens a page on a Limrun device 7.10s
ℹ Limrun: released 1 device(s)
Test Files 1 passed (1)
Tests 1 passed (1)
- A second test idles 90s before driving Safari, past the lease's 60s TTL. It passed and logged no
driver lease renewal failedline. I ran no control without the heartbeat. - After the runs the account has no instance in
creating,assigned, orready. - Not run: Android on Limrun, the
appPathinstall on a live device (Safari is preinstalled, so that client is unit-tested only), ande2e mcp(it reaches the same engineprepare). - A fresh-context review of the diff found nothing to fix.
Checklist
- Changeset added (
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only. - Breaking change: not applicable.
- Docs updated in the same PR: no change needed, the docs do not describe the lease client's session.
- Contract change: not applicable.
- Engine contract change: not applicable.
Written by Claude Fable 5.2 in Claude Code, running in T3 Code.
https://github.com/user-attachments/assets/07357783-67e3-420c-a33e-97b9fc7f8995