[GH-ISSUE #1952] ADB refusals show generic target advice, and a relative REA_ADB_PATH escapes as UNKNOWN #646

Closed
opened 2026-10-15 18:26:54 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @kaoru0822-kitauji on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1952

Observed behavior

The ADB provider has the same two refusal defects that #1945 fixed for apktool (the apktool provider mirrors it):

  1. Relative REA_ADB_PATH → UNKNOWN. REA_ADB_PATH=relative/adb rea list-adb-devices --format json prints:

    {"code":"UNKNOWN","message":"REA_ADB_PATH must be an absolute path to the adb binary"}
    

    AdbProvider#executeOperation and inspectAvailability call this.selection() before the try that maps AdbConfigurationFailure, so the not_absolute failure escapes untyped.

  2. Missing adb → generic target advice. Without adb on PATH, or with REA_ADB_PATH=/nonexistent/adb, ADB tools return capability_unavailable with "This analysis is unavailable for the current target. Choose another analysis or target." as both message and remediation. The reason ("The selected adb binary was not found … Set REA_ADB_PATH …") appears only in details.reason, because the refusal has no userMessage.

tests/boundary/cli/adbCli.test.ts only checks that stdout contains REA_ADB_PATH somewhere, which details.reason already satisfies.

Reproduction

On main 7cdb7981c, on a Mac without adb:

REA_ADB_PATH=relative/adb rea list-adb-devices --format json
rea inspect-adb-client --format json

Expected behavior

Both cases return capability_unavailable, and the message and remediation name the adb configuration problem. The configuration-failure-to-refusal mapping should be shared with apktool rather than copied a second time.

Originally created by @kaoru0822-kitauji on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1952 ### Observed behavior The ADB provider has the same two refusal defects that #1945 fixed for apktool (the apktool provider mirrors it): 1. **Relative `REA_ADB_PATH` → `UNKNOWN`.** `REA_ADB_PATH=relative/adb rea list-adb-devices --format json` prints: ```json {"code":"UNKNOWN","message":"REA_ADB_PATH must be an absolute path to the adb binary"} ``` `AdbProvider#executeOperation` and `inspectAvailability` call `this.selection()` before the `try` that maps `AdbConfigurationFailure`, so the `not_absolute` failure escapes untyped. 2. **Missing adb → generic target advice.** Without adb on `PATH`, or with `REA_ADB_PATH=/nonexistent/adb`, ADB tools return `capability_unavailable` with "This analysis is unavailable for the current target. Choose another analysis or target." as both message and remediation. The reason ("The selected adb binary was not found … Set REA_ADB_PATH …") appears only in `details.reason`, because the refusal has no `userMessage`. `tests/boundary/cli/adbCli.test.ts` only checks that stdout contains `REA_ADB_PATH` somewhere, which `details.reason` already satisfies. ### Reproduction On main `7cdb7981c`, on a Mac without adb: ```sh REA_ADB_PATH=relative/adb rea list-adb-devices --format json rea inspect-adb-client --format json ``` ### Expected behavior Both cases return `capability_unavailable`, and the message and remediation name the adb configuration problem. The configuration-failure-to-refusal mapping should be shared with apktool rather than copied a second time.
bsakaguchi 2026-10-15 18:26:54 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@CassieFox23 commented on GitHub (Oct 11, 2026):

TL;DR: On Linux, main's fix (c42232f56) handles the cases in this issue. Two other bad paths still give a vague message. They don't name REA_ADB_PATH or say what is wrong.

I tested main at dc303a8ee with list-adb-devices, inspect-adb-client and the matching MCP tools.

REA_ADB_PATH Result on main
Relative path Typed refusal: "REA_ADB_PATH must be an absolute path to the adb binary."
Missing file Typed refusal that names the path and REA_ADB_PATH
A file that can't run "The selected adb binary did not report a usable version."
A directory Same as above

The last two rows are capability_unavailable, and the same sentence fills message, remediation and details.reason. apktool does the same for REA_APKTOOL_COMMAND.

Not run: a real device, Windows and macOS.

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

<!-- gh-comment-id:6113613972 --> @CassieFox23 commented on GitHub (Oct 11, 2026): **TL;DR:** On Linux, main's fix (c42232f56) handles the cases in this issue. Two other bad paths still give a vague message. They don't name `REA_ADB_PATH` or say what is wrong. I tested main at dc303a8ee with `list-adb-devices`, `inspect-adb-client` and the matching MCP tools. | `REA_ADB_PATH` | Result on main | | --- | --- | | Relative path | Typed refusal: "REA_ADB_PATH must be an absolute path to the adb binary." | | Missing file | Typed refusal that names the path and `REA_ADB_PATH` | | A file that can't run | "The selected adb binary did not report a usable version." | | A directory | Same as above | The last two rows are `capability_unavailable`, and the same sentence fills `message`, `remediation` and `details.reason`. apktool does the same for `REA_APKTOOL_COMMAND`. Not run: a real device, Windows and macOS. 🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊
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#646
No description provided.