[GH-ISSUE #3865] [Bug] Rejected Electron CLI inputs omit which argument was wrong and why #1485

Closed
opened 2026-10-16 21:06:03 +00:00 by bsakaguchi · 1 comment
Owner

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

Before submitting

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

Area

CLI

Observed behavior

When rea list-electron-targets or rea inspect-electron-page rejects an argument that fails the named Electron input schema, the error tells the caller to "Correct the listed arguments" but lists none: the response has no details and no issues. The equivalent browser commands return the rejected field and reason for the same inputs.

Both Electron commands exit 1 with empty stderr and return the generic error below, with no details field. The browser controls exit 1 and include details with the field path and reason.

Reproduction

No listening endpoint or Electron application is needed; validation fails before any connection.

rea list-electron-targets 'not a url' --json; echo "exit=$?"
rea inspect-electron-page http://127.0.0.1:9222 '' --json; echo "exit=$?"
# Browser controls with the same invalid values
rea list-browser-targets 'not a url' --json; echo "exit=$?"
rea inspect-web-page http://127.0.0.1:9222 '' --json; echo "exit=$?"

Expected behavior

Both Electron commands still return invalid_request with exit 1, and also include details.issues naming the rejected field (cdp_endpoint or target_id) and its reason, as the browser commands do. AGENTS.md:29 requires retaining meaningful boundary failure reasons. src/domain/inputIssueProjection.ts:7 defines the standard input error that retains schema issues, and src/domain/analysisErrorProjection.ts:284 exposes nonempty issues in details. The Electron schema validates cdp_endpoint with browserEndpointSchema (src/domain/javascript/electronObservation.ts:10) and requires a nonempty target_id (line 24).

Impact and scope

Error classification and exit status are correct and no wrong analysis occurs; callers only lose the field and reason needed to correct the request.

Workaround: available. The browser commands report the same cdp_endpoint and target_id constraints, and the Electron schema in src/domain/javascript/electronObservation.ts states them.

Reporter's impact estimate: P3 (supported).

REA version

6.5.0, built from source at main commit 034342ba28 (latest npm release is 6.5.0)

Runtime and platform

Node.js v26.10.0; macOS 27.0.1 arm64

Target and artifact context

not applicable

Interface

CLI

Earliest failure stage

Request parsing or validation

Relevant output or evidence

  • Expected source: AGENTS.md:29 (preserve meaningful failure reasons); src/domain/analysisErrorProjection.ts:284 (issues exposed in details)
  • Failure source: observed CLI output below; inputError(...) called without issues at src/cli/electronCommands.ts:188 and src/cli/electronCommands.ts:217
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Output of both Electron commands (exit 1):

{"error":"Electron analysis failed","code":"invalid_request","category":"invalid_input","message":"Analysis input is invalid. Check the arguments and try again.","retryable":true,"remediation":{"action":"Correct the listed arguments and retry."}}

details from the browser controls (exit 1), respectively:

{"operation":"list_browser_targets","issues":[{"path":["cdp_endpoint"],"reason":"invalid_value","message":"Invalid CDP endpoint URL"}]}
{"operation":"inspect_web_page","issues":[{"path":["target_id"],"reason":"out_of_range","minimum":1}]}

Source-derived analysis: when safeParse fails, the handlers call inputError("list_electron_targets") and inputError("inspect_electron_page") with only the operation name. The helper at src/cli/electronCommands.ts:277 accepts optional issues and input but defaults to an empty issue array, so the projection omits details.

Typed outcome or recovery expected

invalid_request with exit 1 and details.issues naming the rejected field (cdp_endpoint or target_id) and its reason, matching the browser commands.

Restoration check:

rea list-electron-targets 'not a url' --json currently returns no details; after a fix it should still exit 1 with invalid_request and include details.issues with path ["cdp_endpoint"]. rea inspect-electron-page http://127.0.0.1:9222 '' --json should likewise include an issue for ["target_id"]. The browser commands above are the passing control.

Analysis or suspected cause

Source-derived: src/cli/electronCommands.ts:188 and :217 call inputError with only the operation name; the helper at :277 then supplies an empty issue array, so details is omitted.

Additional context

Closed #2180 fixed the same omission for the browser and Inspector commands; the controls confirm that fix still holds, and the Electron siblings were not covered. Closed #2272 concerns path-error attribution in capture_electron_scenario, a different boundary. No valid Electron observation or MCP call was run.

This report came from AI-assisted source review with local reproduction where stated above; the evidence labels distinguish observed runs from source-only reasoning.

Originally created by @coygeek on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/3865 ### 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 CLI ### Observed behavior When `rea list-electron-targets` or `rea inspect-electron-page` rejects an argument that fails the named Electron input schema, the error tells the caller to "Correct the listed arguments" but lists none: the response has no `details` and no issues. The equivalent browser commands return the rejected field and reason for the same inputs. Both Electron commands exit 1 with empty stderr and return the generic error below, with no `details` field. The browser controls exit 1 and include `details` with the field path and reason. ### Reproduction No listening endpoint or Electron application is needed; validation fails before any connection. ```sh rea list-electron-targets 'not a url' --json; echo "exit=$?" rea inspect-electron-page http://127.0.0.1:9222 '' --json; echo "exit=$?" # Browser controls with the same invalid values rea list-browser-targets 'not a url' --json; echo "exit=$?" rea inspect-web-page http://127.0.0.1:9222 '' --json; echo "exit=$?" ``` ### Expected behavior Both Electron commands still return `invalid_request` with exit 1, and also include `details.issues` naming the rejected field (`cdp_endpoint` or `target_id`) and its reason, as the browser commands do. `AGENTS.md:29` requires retaining meaningful boundary failure reasons. `src/domain/inputIssueProjection.ts:7` defines the standard input error that retains schema issues, and `src/domain/analysisErrorProjection.ts:284` exposes nonempty issues in `details`. The Electron schema validates `cdp_endpoint` with `browserEndpointSchema` (`src/domain/javascript/electronObservation.ts:10`) and requires a nonempty `target_id` (line 24). ### Impact and scope Error classification and exit status are correct and no wrong analysis occurs; callers only lose the field and reason needed to correct the request. Workaround: available. The browser commands report the same `cdp_endpoint` and `target_id` constraints, and the Electron schema in `src/domain/javascript/electronObservation.ts` states them. Reporter's impact estimate: P3 (supported). ### REA version 6.5.0, built from source at main commit 034342ba28c8e56c3746be92b78aa7299afa02bd (latest npm release is 6.5.0) ### Runtime and platform Node.js v26.10.0; macOS 27.0.1 arm64 ### Target and artifact context not applicable ### Interface CLI ### Earliest failure stage Request parsing or validation ### Relevant output or evidence - Expected source: `AGENTS.md:29` (preserve meaningful failure reasons); `src/domain/analysisErrorProjection.ts:284` (issues exposed in `details`) - Failure source: observed CLI output below; `inputError(...)` called without issues at `src/cli/electronCommands.ts:188` and `src/cli/electronCommands.ts:217` - Evidence provenance: observed - Local verification: reproduced - Reproduction completeness: complete Output of both Electron commands (exit 1): ```json {"error":"Electron analysis failed","code":"invalid_request","category":"invalid_input","message":"Analysis input is invalid. Check the arguments and try again.","retryable":true,"remediation":{"action":"Correct the listed arguments and retry."}} ``` `details` from the browser controls (exit 1), respectively: ```json {"operation":"list_browser_targets","issues":[{"path":["cdp_endpoint"],"reason":"invalid_value","message":"Invalid CDP endpoint URL"}]} {"operation":"inspect_web_page","issues":[{"path":["target_id"],"reason":"out_of_range","minimum":1}]} ``` Source-derived analysis: when `safeParse` fails, the handlers call `inputError("list_electron_targets")` and `inputError("inspect_electron_page")` with only the operation name. The helper at `src/cli/electronCommands.ts:277` accepts optional issues and input but defaults to an empty issue array, so the projection omits `details`. ### Typed outcome or recovery expected invalid_request with exit 1 and details.issues naming the rejected field (cdp_endpoint or target_id) and its reason, matching the browser commands. Restoration check: `rea list-electron-targets 'not a url' --json` currently returns no `details`; after a fix it should still exit 1 with `invalid_request` and include `details.issues` with path `["cdp_endpoint"]`. `rea inspect-electron-page http://127.0.0.1:9222 '' --json` should likewise include an issue for `["target_id"]`. The browser commands above are the passing control. ### Analysis or suspected cause Source-derived: src/cli/electronCommands.ts:188 and :217 call inputError with only the operation name; the helper at :277 then supplies an empty issue array, so details is omitted. ### Additional context Closed #2180 fixed the same omission for the browser and Inspector commands; the controls confirm that fix still holds, and the Electron siblings were not covered. Closed #2272 concerns path-error attribution in `capture_electron_scenario`, a different boundary. No valid Electron observation or MCP call was run. This report came from AI-assisted source review with local reproduction where stated above; the evidence labels distinguish observed runs from source-only reasoning.
Author
Owner

@yankikucuk commented on GitHub (Oct 15, 2026):

Working on this. Reproduced: both Electron commands returned invalid_request without details while the browser controls listed the field. The handlers now pass the schema issues and the submitted input to the shared input error, so details.issues names cdp_endpoint / target_id with the reason through the same secret-safe projection the browser commands use; a boundary suite mirroring the browser diagnostics covers both commands and the credential non-echo case. Draft PR follows shortly.

<!-- gh-comment-id:6189888243 --> @yankikucuk commented on GitHub (Oct 15, 2026): Working on this. Reproduced: both Electron commands returned `invalid_request` without `details` while the browser controls listed the field. The handlers now pass the schema issues and the submitted input to the shared input error, so `details.issues` names `cdp_endpoint` / `target_id` with the reason through the same secret-safe projection the browser commands use; a boundary suite mirroring the browser diagnostics covers both commands and the credential non-echo case. Draft PR follows shortly.
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#1485
No description provided.