You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mobile: worker replacement closes a provider-leased session and drops its device claim #792
A DeviceProvider cannot hold its device for the whole run on a local agent-device host. A worker replacement drops the device claim in the middle of the run.
agent-device ties host-wide device claims to a session that has an app open. A provider can take the claim by opening the slot's session (e2e-<target>-<slot>) in acquire, and the worker then resumes that session. But:
e2e retires a worker after every failing unit (run/scheduler.js: if (worker.sawFailure) this.retire(worker)).
@e2e-dev/mobile's AgentDeviceSurface.dispose() calls client.sessions.close() on the slot session.
That close releases the device claim. Until the replacement worker reopens the session, another agent-device session can take the device or install over it.
The provider can't bridge the gap. It cannot hold a second claim-holding session, because that would block the engine's own session. agent-device 0.21.18 also has no lease that is independent of a session.
When a slot is bound to a provider lease, have worker disposal keep the session (and its claim) open, for example by closing the app instead of the session, and leave closing the session to finish/release. Alternatively, add a provider hook that runs around worker replacement.
I think the useful invariant here is that worker lifetime is an implementation detail; externally leased resource lifetime belongs to the slot/run that owns the lease.
If a failing unit retires a worker, disposal should be allowed to tear down the worker client/app without releasing the provider-backed device claim. The replacement worker should resume the same slot lease, and only provider release/run finish should end ownership.
A regression test that intentionally fails one unit, forces worker replacement, then proves (1) the replacement resumes the same lease/session and (2) a competing session cannot claim the device during the gap would pin the root cause much more strongly than a provider-specific workaround. Does that match where you want the provider/engine lifecycle boundary to live?
Fixed in #1209: when a slot holds a provider lease, worker replacement now keeps the session and its device claim, and only release / run finish closes it. It's on main and in the nightly (npm i @e2e-dev/mobile@nightly e2e@nightly), and ships in the next stable release.
Activity
kvnloo commentedon Oct 3, 2026
I think the useful invariant here is that worker lifetime is an implementation detail; externally leased resource lifetime belongs to the slot/run that owns the lease.
If a failing unit retires a worker, disposal should be allowed to tear down the worker client/app without releasing the provider-backed device claim. The replacement worker should resume the same slot lease, and only provider
release/run finish should end ownership.A regression test that intentionally fails one unit, forces worker replacement, then proves (1) the replacement resumes the same lease/session and (2) a competing session cannot claim the device during the gap would pin the root cause much more strongly than a provider-specific workaround. Does that match where you want the provider/engine lifecycle boundary to live?
okwasniewski commentedon Oct 19, 2026
Fixed in #1209: when a slot holds a provider lease, worker replacement now keeps the session and its device claim, and only
release/ run finish closes it. It's on main and in the nightly (npm i @e2e-dev/mobile@nightly e2e@nightly), and ships in the next stable release.