Skip to content

break(sdk): stop accepting serverPort on device-scoped adb executors #2640

Description

@thymikee

Purpose

After #2632 an adb request carries its server in the invocation's target, which is the only channel a route can actually run against. AndroidAdbExecutorOptions.serverPort still exists on the same options bag, and several functions exist only to police a field that can never win on the device routes. Removing it from those types makes a mismatch unrepresentable instead of refused.

Current shape

export type AndroidAdbExecutorOptions = {
  allowFailure?: boolean;
  timeoutMs?: number;
  // …
  serverPort?: number; // second channel: ignored on device routes, refused under a lease
};

export type AndroidAdbExecutor = (
  args: string[],
  options?: AndroidAdbExecutorOptions,
) => Promise<AndroidAdbExecutorResult>;

Required behavior

  • Device-scoped surfaces — AndroidAdbExecutor, AndroidAdbSpawner, and the *WithAdb helpers exported by agent-device/android-adb — stop declaring serverPort. The port a device route uses stays what it was built with (createLocalAndroidAdbProvider(device, { serverPort }), createDeviceAdbExecutor(device, { serverPort })) or what the active lease owns.
  • Host-level adb keeps a per-call port, because there the caller owns the server: runAndroidHostAdb(invocation, { serverPort: 15_038 }). It shares AndroidAdbExecutorOptions with the device routes today, so splitting the two option types is the first step.
  • A JavaScript caller that still passes serverPort to a device executor gets the route's own server, as today. No runtime sniffing of an option the type no longer declares; the lease refusal stays where the lease is known.

Observable completion

  • serverPort is absent from the options type that agent-device/android-adb publishes (AndroidAdbExecutorOptions, re-exported by src/sdk/android-adb.ts), while the host options type still declares it.
  • These stop existing or shrink to one channel each: deviceServerPort's three-way precedence, the serverPort destructuring in createSerialAdbExecutor and createSerialAdbSpawner, the option-channel removal in lowerAndroidAdbInvocation, and the per-call callers of requireSameAndroidAdbServer in execOnScopedTransport.
  • Existing lease tests keep passing unchanged: a leased route still refuses a construction port that differs.

Compatibility

Type-level narrowing of an input type in a published surface: code that passes serverPort to a device executor stops compiling, and no released runtime behavior changes for callers who never passed it. The semver call (minor with a changelog note, or wait for the next major) belongs to a maintainer, along with whether to deprecate the field for one release first.

Dependencies

Blocked by: #2632 landing. Not coupled to #2026 (quoting) or the daemon/root closure work in #2545.

Exclusions

No change to lease environment plumbing (ANDROID_ADB_SERVER_PORT lowering), discovery, or provider admission.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions