[GH-ISSUE #4257] [Bug] Electron passive CLI commands omit request cancellation #1682

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

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

[Bug] Electron passive CLI commands bypass command cancellation

Observed result

Source review: list-electron-targets and inspect-electron-page do not pass a cancellation signal from the CLI command boundary to the provider. No CLI interrupt reproduction was run in this audit; this report is source-derived.

Baseline: repository 0e1f0bf2d, macOS, Node v24.18.0.

Evidence

  • src/cli/electronCommands.ts:182-193 and :208-221 invoke the Electron application services without withCommandCancellation and without ExecutionOptions.signal.
  • The paired passive browser handlers consistently wrap execution with withCommandCancellation and pass { signal } (src/cli/browserCommands.ts:51-75,93-124).
  • The Electron provider already consumes options.signal for endpoint discovery and page inspection (src/browser/CdpElectronProvider.ts:40-48,107-148), and inspect-electron-page accepts a configurable observation window.
  • All-state GitHub issue search found no exact report. Related #4027 is a broad area tracker; #3865 concerns rejected-input diagnostics.

Impact

SIGINT/SIGTERM cannot flow through the passive Electron CLI adapter as typed request cancellation. In particular, a page inspection can continue its CDP observation and cannot use the provider's awaited detach/transport cleanup path through the intended CLI cancellation owner.

Proposed structural fix

Wrap both passive Electron CLI handlers in withCommandCancellation and pass its signal into listElectronTargets / inspectElectronPage. Keep cancellation handling at the command boundary, matching the browser CLI pattern.

Acceptance check

Use a disposable Electron CDP target. Interrupt target discovery and page inspection through the public CLI; require the conventional interrupt exit code, cancellation classification, completed detach/transport cleanup, survival of the external target, and a successful subsequent target request. Add the equivalent CLI boundary regression without sharing a user-owned application.

Originally created by @morluto on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4257 # [Bug] Electron passive CLI commands bypass command cancellation ## Observed result Source review: `list-electron-targets` and `inspect-electron-page` do not pass a cancellation signal from the CLI command boundary to the provider. No CLI interrupt reproduction was run in this audit; this report is source-derived. Baseline: repository `0e1f0bf2d`, macOS, Node `v24.18.0`. ## Evidence - `src/cli/electronCommands.ts:182-193` and `:208-221` invoke the Electron application services without `withCommandCancellation` and without `ExecutionOptions.signal`. - The paired passive browser handlers consistently wrap execution with `withCommandCancellation` and pass `{ signal }` (`src/cli/browserCommands.ts:51-75,93-124`). - The Electron provider already consumes `options.signal` for endpoint discovery and page inspection (`src/browser/CdpElectronProvider.ts:40-48,107-148`), and `inspect-electron-page` accepts a configurable observation window. - All-state GitHub issue search found no exact report. Related #4027 is a broad area tracker; #3865 concerns rejected-input diagnostics. ## Impact SIGINT/SIGTERM cannot flow through the passive Electron CLI adapter as typed request cancellation. In particular, a page inspection can continue its CDP observation and cannot use the provider's awaited detach/transport cleanup path through the intended CLI cancellation owner. ## Proposed structural fix Wrap both passive Electron CLI handlers in `withCommandCancellation` and pass its signal into `listElectronTargets` / `inspectElectronPage`. Keep cancellation handling at the command boundary, matching the browser CLI pattern. ## Acceptance check Use a disposable Electron CDP target. Interrupt target discovery and page inspection through the public CLI; require the conventional interrupt exit code, cancellation classification, completed detach/transport cleanup, survival of the external target, and a successful subsequent target request. Add the equivalent CLI boundary regression without sharing a user-owned application.
bsakaguchi 2026-10-16 21:09:01 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
Author
Owner

@morluto commented on GitHub (Oct 16, 2026):

Fixed on main in 93c620c3e. Both passive Electron CLI handlers now forward request cancellation and finish through the provider cleanup owner.

The public inspection CLI regression checks cancelled exit, detach and external-browser survival against fake CDP. Target-list wiring was inspected; no real Electron run is claimed.

Hosted main CI is still pending; this closure is based on the implemented fix and the scoped regression evidence.

<!-- gh-comment-id:6206012193 --> @morluto commented on GitHub (Oct 16, 2026): Fixed on `main` in [93c620c3e](https://github.com/morluto/rea/commit/93c620c3e7c401be40b71c480518147c76ade4dc). Both passive Electron CLI handlers now forward request cancellation and finish through the provider cleanup owner. The public inspection CLI regression checks cancelled exit, detach and external-browser survival against fake CDP. Target-list wiring was inspected; no real Electron run is claimed. Hosted main CI is still pending; this closure is based on the implemented fix and the scoped regression evidence.
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#1682
No description provided.