[GH-ISSUE #5981] [Bug] ADB version-probe failures name inspect_adb_client during list_adb_devices #3649

Closed
opened 2026-10-31 00:42:43 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @coygeek on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5981

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Provider or capability discovery

Observed behavior

Running list-adb-devices with a launcher whose version output exceeds the 65,536-byte capture allowance returns resource_constraint with details.operation: "inspect_adb_client". The requested operation was list_adb_devices. The resource failure itself is correctly refused; its operation attribution names the prerequisite probe. This reproduced through the built CLI with an inert ADB substitute, without a device.

Reproduction

From a built checkout, run on a POSIX host:

work_dir="$(mktemp -d)"
cat > "$work_dir/adb" <<'JS'
#!/usr/bin/env node
process.stdout.write("x".repeat(70000));
JS
chmod 755 "$work_dir/adb"
REA_ADB_PATH="$work_dir/adb" node scripts/rea.mjs list-adb-devices --format json

Observed twice: exit 1, empty stderr, resource_constraint, and details.operation: "inspect_adb_client". The repeat used Node 24.22.0. A control replacing the same executable with valid version output and an empty device list exited 0 with Evidence operation list_adb_devices:

#!/usr/bin/env node
process.stdout.write(process.argv[2] === "version"
  ? "Android Debug Bridge version 1.0.41\nVersion 34.0.5\n"
  : "List of devices attached\n");

Expected behavior

Attribute failures at the shared client boundary to the requested operation while retaining their original cause, capture limits and output. The existing analysisClientFailureForOperation helper owns this translation; Apktool applies it using request.operation.

Impact and scope

P3: incorrect diagnostic attribution for a correctly refused request. The demonstrated overflow keeps its correct category, capture limit and refusal. A caller can retain its requested operation separately when interpreting the error. No change to retry behavior, device access or successful analysis was demonstrated. Source inspection also identifies cancellation and timeout errors from this same probe as affected; those two manifestations were not executed.

REA version

rea-agents 6.7.0; source 5241597594.

Runtime and platform

Node.js v26.12.0 and v24.22.0; macOS 27.0.1 arm64; built source CLI with locked dependencies.

Target and artifact context

Inert executable substitute for the caller-selected ADB binary. No APK, Android device, ADB server or real platform-tools installation.

Interface

CLI

Earliest failure stage

Setup or provider admission

Relevant output or evidence

Selected fields from actual CLI stdout (bounded captured output and launcher path omitted):

{
  "code": "resource_constraint",
  "category": "resource_constraint",
  "message": "adb version output exceeded the 65536-byte capture budget",
  "retryable": false,
  "details": {
    "operation": "inspect_adb_client",
    "resource": "memory",
    "reason": "adb version output exceeded the 65536-byte capture budget",
    "reported_limits": {"max_output_bytes": 65536}
  }
}

The command invoked was list-adb-devices; the successful control returned operation: "list_adb_devices".

Typed outcome or recovery expected

Keep resource_constraint, the 65,536-byte bound, and bounded captured diagnostics. Set details.operation to list_adb_devices. Shared probe cancellation and deadline results should likewise retain the requested operation; a deadline result uses provider_timeout.

Analysis or suspected cause

Source-derived explanation: inspectAdbClient constructs typed failures with inspect_adb_client. AdbProvider calls that probe for the requested operation and returns AnalysisError unchanged. The public projection exposes the resource error operation.

Additional context

Closed #3886 addressed timeout classification as a capability error; this report concerns the operation named after the probe already produces a correctly typed failure. #5689 concerns unusable-launcher diagnostics; #3369 concerns checksum capture after a push. PRs #4655, #4720 and #4963 concern device/file operands, not client-probe operation attribution. Checked upstream main 25e1a24a3e; the admission block is unchanged. Current main was inspected, not separately built or executed. MCP transport and real-device behavior were not exercised.

Originally created by @coygeek on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5981 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Provider or capability discovery ### Observed behavior Running `list-adb-devices` with a launcher whose version output exceeds the 65,536-byte capture allowance returns `resource_constraint` with `details.operation: "inspect_adb_client"`. The requested operation was `list_adb_devices`. The resource failure itself is correctly refused; its operation attribution names the prerequisite probe. This reproduced through the built CLI with an inert ADB substitute, without a device. ### Reproduction From a built checkout, run on a POSIX host: ```sh work_dir="$(mktemp -d)" cat > "$work_dir/adb" <<'JS' #!/usr/bin/env node process.stdout.write("x".repeat(70000)); JS chmod 755 "$work_dir/adb" REA_ADB_PATH="$work_dir/adb" node scripts/rea.mjs list-adb-devices --format json ``` Observed twice: exit 1, empty stderr, `resource_constraint`, and `details.operation: "inspect_adb_client"`. The repeat used Node 24.22.0. A control replacing the same executable with valid version output and an empty device list exited 0 with Evidence operation `list_adb_devices`: ```js #!/usr/bin/env node process.stdout.write(process.argv[2] === "version" ? "Android Debug Bridge version 1.0.41\nVersion 34.0.5\n" : "List of devices attached\n"); ``` ### Expected behavior Attribute failures at the shared client boundary to the requested operation while retaining their original cause, capture limits and output. The existing [analysisClientFailureForOperation helper](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/providers/AnalysisClientFailure.ts#L234-L249) owns this translation; [Apktool applies it using request.operation](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/apktool/ApktoolProvider.ts#L377-L391). ### Impact and scope P3: incorrect diagnostic attribution for a correctly refused request. The demonstrated overflow keeps its correct category, capture limit and refusal. A caller can retain its requested operation separately when interpreting the error. No change to retry behavior, device access or successful analysis was demonstrated. Source inspection also identifies cancellation and timeout errors from this same probe as affected; those two manifestations were not executed. ### REA version rea-agents 6.7.0; source 52415975942a4b9c53a817915b313ccc404f280e. ### Runtime and platform Node.js v26.12.0 and v24.22.0; macOS 27.0.1 arm64; built source CLI with locked dependencies. ### Target and artifact context Inert executable substitute for the caller-selected ADB binary. No APK, Android device, ADB server or real platform-tools installation. ### Interface CLI ### Earliest failure stage Setup or provider admission ### Relevant output or evidence Selected fields from actual CLI stdout (bounded captured output and launcher path omitted): ```json { "code": "resource_constraint", "category": "resource_constraint", "message": "adb version output exceeded the 65536-byte capture budget", "retryable": false, "details": { "operation": "inspect_adb_client", "resource": "memory", "reason": "adb version output exceeded the 65536-byte capture budget", "reported_limits": {"max_output_bytes": 65536} } } ``` The command invoked was `list-adb-devices`; the successful control returned `operation: "list_adb_devices"`. ### Typed outcome or recovery expected Keep `resource_constraint`, the 65,536-byte bound, and bounded captured diagnostics. Set `details.operation` to `list_adb_devices`. Shared probe cancellation and deadline results should likewise retain the requested operation; a deadline result uses `provider_timeout`. ### Analysis or suspected cause Source-derived explanation: [inspectAdbClient constructs typed failures with inspect_adb_client](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/adb/AdbConfiguration.ts#L122-L163). [AdbProvider calls that probe for the requested operation and returns AnalysisError unchanged](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/adb/AdbProvider.ts#L1280-L1311). The public [projection exposes the resource error operation](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/domain/analysisErrorProjection.ts#L304-L310). ### Additional context Closed #3886 addressed timeout classification as a capability error; this report concerns the operation named after the probe already produces a correctly typed failure. #5689 concerns unusable-launcher diagnostics; #3369 concerns checksum capture after a push. PRs #4655, #4720 and #4963 concern device/file operands, not client-probe operation attribution. Checked upstream main 25e1a24a3ed3671a0148757555f18d16c29d936a; the admission block is unchanged. Current main was inspected, not separately built or executed. MCP transport and real-device behavior were not exercised.
Author
Owner

@coygeek commented on GitHub (Oct 24, 2026):

Checked the reported fix on main at d87e73f2db.

AdbProvider now translates typed inspectAdbClient failures with analysisClientFailureForOperation using request.operation, retaining prerequisite_operation diagnostics and the original cause. The regression runs list_adb_devices with a version stub exceeding capture capacity and asserts resource_constraint, operation=list_adb_devices and prerequisite_operation=inspect_adb_client. This is an inert process-boundary test, not real-device verification.

Implementation: AdbProvider.ts, AdbProvider.test.ts.

The relevant regression checks in AdbProvider.test.ts passed in the focused test run on this revision. This closure is based on the current source and those checks; provider fixtures do not establish a real-engine run. Closing as completed on main.

<!-- gh-comment-id:6380744317 --> @coygeek commented on GitHub (Oct 24, 2026): Checked the reported fix on `main` at d87e73f2db50be72d33a4b3c7199af35518b441c. AdbProvider now translates typed inspectAdbClient failures with analysisClientFailureForOperation using request.operation, retaining prerequisite_operation diagnostics and the original cause. The regression runs list_adb_devices with a version stub exceeding capture capacity and asserts resource_constraint, operation=list_adb_devices and prerequisite_operation=inspect_adb_client. This is an inert process-boundary test, not real-device verification. Implementation: [AdbProvider.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/adb/AdbProvider.ts#L1337), [AdbProvider.test.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/adb/AdbProvider.test.ts#L2237). The relevant regression checks in [AdbProvider.test.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/adb/AdbProvider.test.ts) passed in the focused test run on this revision. This closure is based on the current source and those checks; provider fixtures do not establish a real-engine run. Closing as completed on main.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3649
No description provided.