fix(mobile): report the installed agent-device version to device providers

Merged
LE
2d ago
+70-11

What

DeviceRequest.agentDeviceVersion is now the version of the agent-device that @e2e-dev/mobile loads. A project that forces another version with npm or pnpm overrides no longer has its providers told the declared one.

Why

The value came from @e2e-dev/mobile's own package.json, while the engine and the lease daemon run whatever agent-device resolves.

How it works

  1. packages/mobile/src/provider.ts:204: agentDeviceVersion() reads installedPackage(import.meta.resolve('agent-device')).version, the lookup lease/daemon.ts:13 already uses. It resolves on first use, so importing the module does not touch the filesystem.
  2. packages/mobile/src/provider.ts:270: each DeviceRequest gets that value.
  3. EAS docs: the default is the version @e2e-dev/mobile reports, no longer the one it pins. The wording also holds for older mobile releases EAS accepts.

With an override, behaviour changes for consumers of the value: EAS and E2B start their daemon at the installed version, and TestMu, Revyl and Limrun require their side to match it. Without an override nothing changes.

Limit: a fork or local build of agent-device reports its own manifest version, which EAS or E2B may not be able to install from npm.

Issue

Fixes #2487

Verified

Ran it locally: yes

A project on @e2e-dev/mobile@0.12.9 with "overrides": { "agent-device": "0.21.43" }, printing what the provider receives, with dist/provider.js swapped for each build:

mainthis PR
request.agentDeviceVersion0.21.42 (declared)0.21.43 (installed)

The new test tests/unit/provider-version.test.ts on main's provider.ts, then on this branch:

AssertionError: expected '0.21.44' to be '99.0.0-resolved'
pnpm check: pass
mobile 709, eas 49, testmu 86, revyl 53, limrun 18, e2b 66, browserstack 53 tests passed

No live hosted-device run. No docs screenshot: the wording changed, the rendered layout did not.

Checklist

  • Changeset added (pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.
  • Breaking change: title carries !, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).
  • Docs updated in the same PR: the docs/**/*.mdx page for the behavior, and skills/e2e/ if the skill describes it.
  • Contract change: emitted .d.ts reviewed, tests/types/sdk-types.ts updated; wire change edits the schema and both fixtures.
  • Engine contract change (e2e/engine): changesets for e2e, @e2e-dev/web, and @e2e-dev/mobile.

Summary by CodeRabbit

  • Bug Fixes

    • Device providers now use the installed agent-device version, including versions selected through package-manager overrides, rather than relying on the declared dependency version.
  • Documentation

    • Clarified that the default agent-device version matches the version reported for the mobile client.
    • Noted that TestMu and Revyl provider plugins must match the installed agent-device version.