Repository navigation
break(sdk): stop accepting serverPort on device-scoped adb executors #2640
Description
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*WithAdbhelpers exported byagent-device/android-adb— stop declaringserverPort. 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 sharesAndroidAdbExecutorOptionswith the device routes today, so splitting the two option types is the first step. - A JavaScript caller that still passes
serverPortto 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
serverPortis absent from the options type thatagent-device/android-adbpublishes (AndroidAdbExecutorOptions, re-exported bysrc/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, theserverPortdestructuring increateSerialAdbExecutorandcreateSerialAdbSpawner, the option-channel removal inlowerAndroidAdbInvocation, and the per-call callers ofrequireSameAndroidAdbServerinexecOnScopedTransport. - 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
thymikee commentedon Oct 12, 2026
Closing as superseded by merged #3390, following the managed-allocation removal in #3372.
The construction-time/scope-level ADB server-port lane was removed.
AndroidAdbExecutorOptions.serverPortis retained as the per-call SDK route, honored by the supplied executor, as documented in ADR 0021.This issue’s premise—that the per-call field cannot win and should be deleted—is therefore obsolete. Closing the old proposal as not planned, rather than implementing a type narrowing that would remove the supported route.