fix(mobile): restore install paths on leased daemons (ENG-1557)

Merged
MI
2d ago
+129-16

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

  1. packages/mobile/src/surface.ts:1056 uses 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 get INVALID_ARGUMENT.
  2. packages/mobile/tests/unit/install-paths.test.ts exercises the built-in
    mobile engine through launch(mobile()) and the pinned client. It checks
    requests and uploads for install and reinstall against a local HTTP responder.
  3. 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
Casemain 6c87952d8this PR
Absolute daemon-only buildINVALID_ARGUMENT before the daemon gets a requestInstall and reinstall receive the path without an upload
Absolute path missing on both runner and daemonINVALID_ARGUMENT before installThe scripted daemon receives the request and e2e surfaces its message as ENGINE_FAILURE
Runner-visible buildUploads and installsUploads and installs
Empty or missing relative pathINVALID_ARGUMENT before installINVALID_ARGUMENT before install
Install with the target's build and no argumentUploads the target buildUploads 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 on cfebc58c. 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.