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.
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.serverPortstill 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
Required behavior
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.runAndroidHostAdb(invocation, { serverPort: 15_038 }). It sharesAndroidAdbExecutorOptionswith the device routes today, so splitting the two option types is the first step.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.deviceServerPort's three-way precedence, theserverPortdestructuring increateSerialAdbExecutorandcreateSerialAdbSpawner, the option-channel removal inlowerAndroidAdbInvocation, and the per-call callers ofrequireSameAndroidAdbServerinexecOnScopedTransport.Compatibility
Type-level narrowing of an input type in a published surface: code that passes
serverPortto 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_PORTlowering), discovery, or provider admission.