fix(mobile): restore install paths on leased daemons (ENG-1557)
What
device.installApp(path) again forwards an absolute path to a leased
agent-device daemon for install and reinstall when only the daemon has the
build. The path must be absolute under the runner's filesystem rules.
Why
The runner-side path check from #2292 ran before mobile called agent-device. A build
that existed only on the daemon was rejected before the daemon saw the path.
How it works
packages/mobile/src/surface.ts:1056uses the worker's current daemon
binding to let agent-device handle an absolute path. Agent-device uploads
a build it finds on the runner and forwards a daemon-only path with the
install request. Empty paths and missing paths that require a runner-side
build still getINVALID_ARGUMENT.packages/mobile/tests/unit/install-paths.test.tsexercises the built-in
mobile engine throughlaunch(mobile())and the pinned client. It checks
requests and uploads for install and reinstall against a local HTTP responder.- The device API comment, mobile reference, both writing-tests skill copies,
and patch changeset describe the lease requirement and runner path rules.
Issue
ENG-1557
Verified
Ran it locally: yes
Called session.device.installApp(path) through launch(mobile()) with a
provider-leased Android daemon. The path named a build on the scripted
daemon and was absent from the runner.
main: INVALID_ARGUMENT, no install request
this PR: the scripted daemon receives the build path and returns success
| Case | main 6c87952d8 | this PR |
|---|---|---|
| Absolute daemon-only build | INVALID_ARGUMENT before the daemon gets a request | Install and reinstall receive the path without an upload |
| Absolute path missing on both runner and daemon | INVALID_ARGUMENT before install | The scripted daemon receives the request and e2e surfaces its message as ENGINE_FAILURE |
| Runner-visible build | Uploads and installs | Uploads and installs |
| Empty or missing relative path | INVALID_ARGUMENT before install | INVALID_ARGUMENT before install |
| Install with the target's build and no argument | Uploads the target build | Uploads the target build |
- Ran the Linear reproduction and
pnpm --filter @e2e-dev/mobile exec vitest run tests/unit/install-paths.test.ts
on main and the candidate. - A local scripted HTTP daemon verified install and reinstall requests,
upload bytes, and the error surfaced for a missing build. The test
verifies the request and response through the pinned client. Live
devices and hosted providers were outside this check. The docs check
passed oncfebc58c. The focused install and engine suites passed
all 336 tests on the same commit.
Selecting a daemon solely through AGENT_DEVICE_DAEMON_BASE_URL still
rejects a daemon-only path. This change covers the provider lease.
A provider's daemon must allow paths on its own filesystem for the
forwarded request to install a build. The local checks do not establish
that policy for E2B or EAS. A device benchmark was outside this
scripted-daemon verification.