Skip to content

refactor(provider-webdriver): ship AWS Device Farm as the @agent-device/aws-device-farm plugin #3310

Closed

Description

@thymikee

Purpose and evidence

0.22 stops bundling hosted device providers with the default installation. AWS Device Farm already presents the plugin factory shape inside core (packages/provider-webdriver/src/aws-device-farm-provider.ts plus aws-device-farm-connection.ts, PR #3312). The one capability it needs that ProviderPluginHost does not expose is a host-command runner: the provider drives aws devicefarm ... through runHostCommand, which core currently supplies in src/provider-webdriver.ts.

Final 0.22 delivery contract

For AWS Device Farm (@agent-device/aws-device-farm), follow the maintainer decision and shared acceptance in #4591. Core may retain only declarative help/docs/schema/catalog and installation-guidance metadata. Do not ship the plugin factory, executable implementation, plugin-only workers or dedicated runtime dependencies in the core npm package. Lazy-loading code that remains in the tarball is not extraction.

Plugin code is installed separately, on demand, by the existing agent-device plugin manager. T3 Code and e2e must use that shared installation/selection lifecycle and machine-readable inventory/recovery, rather than bespoke npm commands or private-store manipulation. Keep current v2 factories and ./agent-device; older manifest/static-registration examples below describe historical preparation and do not override this final distribution contract. Preserve independently required core contracts and local-device code.

Required behavior and boundary

  • Extend the experimental plugin SDK: ProviderPluginHost gains runHostCommand(command, args): Promise<{ stdout }> backed by runCmd with the bounds core uses today (10 MiB buffer, 30 s). Keep the SDK declaration small; the packed declaration-size guard from feat: add managed provider plugin infrastructure #3121 stays green.
  • New workspace package packages/provider-aws-device-farm publishing @agent-device/aws-device-farm, built and released like TestMu. The default export returns { webDriver, connection }; the manifest declares provider: "aws-device-farm" and the connection capabilities from CLOUD_WEBDRIVER_PROVIDER_DECLARATIONS (no credentialVariables: the AWS CLI credential chain has no environment fingerprint, and the fingerprint tests pin that).
  • Move aws-device-farm.ts, aws-device-farm-artifacts.ts, aws-device-farm-provider.ts, aws-device-farm-connection.ts, aws-device-farm-connection-verification.ts and their tests out of provider-webdriver. The requires --aws-project-arn <arn> or AWS_DEVICE_FARM_PROJECT_ARN messages and the flag-then-AGENT_DEVICE_*-then-AWS_* selector order stay as they are.
  • Core drops aws-device-farm from BUNDLED_CLOUD_WEBDRIVER_PROVIDERS and RESERVED_PLUGIN_PROVIDERS; connectionProviderCapabilities and the requiresAppAttachment reconnect hint in connection-presentation.ts keep working from the manifest.
  • Help, website/docs/docs/aws-device-farm.md, device-clouds.md, plugins.md, and the README move the provider to the plugin install flow.
agent-device plugins add @agent-device/aws-device-farm
agent-device connect aws-device-farm --platform android --aws-project-arn <arn> --aws-device-arn <arn> --aws-app-arn <arn>

Completion and validation

  • node scripts/check-provider-plugin.mjs packages/provider-aws-device-farm passes with a fixture aws on PATH.
  • The published name drops the provider- prefix and the directory keeps it. packages/provider-aws-device-farm/package.json declares "name": "@agent-device/aws-device-farm". The provider plugin catalog (src/commands/provider-plugin-catalog.ts), help, docs, and every plugins add example use that name. This is the convention that packages/provider-testmu (@agent-device/testmu) and packages/provider-revyl (@agent-device/revyl) follow.
  • The AWS provider-scenario tests (cloud-webdriver-provider-adapters, cloud-webdriver-provider-regressions, stale-provider-runtime-admission) build the runtime from the plugin factory with the fake host command.
  • pnpm check:affected --run passes; Size report shows the default install shrinking.
  • One live Device Farm remote-access session with the packed plugin, recorded in the PR, or the exact blocker named.

Dependencies and readiness

Blocked by: #3312 landing on main; do the BrowserStack extraction first so the packaging template is proven twice before the SDK change here.

Effort: M. Risk: medium (SDK surface grows by one method; AWS live verification needs an account).

Activity

  1. added this to the 0.22 milestone on Oct 7, 2026
  2. thymikee commented on Nov 16, 2026

    @thymikee
    MemberAuthor

    Decision: plugin distribution: final 0.22 extraction means separate agent-device-managed installation, not merely lazy loading. Core retains declarative help/docs/catalog metadata, with no shipped plugin implementation or dedicated dependency closure. T3 Code and e2e use the same management owner and observable install/selection/recovery contract. The issue body now states this explicitly; #4591 owns shared consumer acceptance and the approximately 3 MB unpacked-core target. Earlier seam-only/static-registration or v1 manifest wording is historical preparation, not the final requirement. Existing extraction owners, sequencing, host/session ownership and publication prerequisites remain in force.

  3. apex-sentinel-staging commented on Nov 16, 2026

    @apex-sentinel-staging

    Apex Sentinel · Issue review

    Suggested label: feature

    The issue requests a refactor/packaging change: extract AWS Device Farm support from core into a separate plugin package and add a ProviderPluginHost capability, with concrete implementation steps and validation. It is not reporting broken behavior or asking for help.

    Possible duplicates

  4. thymikee commented on Nov 20, 2026

    @thymikee
    MemberAuthor

    Done on 0.22 under this issue's own terms: #4617 extracted AWS Device Farm as the @agent-device/aws-device-farm plugin. The published nightly was installed and activated by a clean consumer (#4591 status of 2026-11-18).

    Stated plainly: no live AWS Device Farm session was run. The issue allows "or the exact blocker named", and the PR body names it: no admitted Device Farm route, and AWS account access and the project, device and app ARNs were not verified. The route setUpSlot -> plugin.setup -> host.runHostCommand with the daemon cwd and env therefore has unit and fixture coverage only. Reopen if a live run is wanted before the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions