[GH-ISSUE #201] fix(process): dispatch input and resize events for silent PTY starts #146

Closed
opened 2026-10-15 18:21:38 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @morluto on GitHub (Jul 14, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/201

Environment

  • Local REA repo
  • process-capture adapter

Symptom

Interactive process-capture scenarios that only include input and/or resize events are not dispatched when the target process does not emit any terminal output before the first scheduled event.

Evidence

In startCaptureRuntime, startScenarioEvents is deferred when eventsRequireReadiness(scenario) is true:

  • eventsRequireReadiness returns true if any event is input or resize.
  • In that case, scenario events are triggered via onFirstOutput callback in captureTerminalFrames, not immediately.
  • For PTY targets that produce no output before waiting for stdin (for example /bin/cat, read, many REPLs waiting silently), the onData handler may never fire.
  • As a result, scheduled input/resize events never run, and the capture can terminate on timeout/idle timeout with target interactions never sent.

Repro scenario

  1. Run a capture with an executable that is interactive but outputs nothing before first input (for example, a scenario invoking /bin/cat).
  2. Add an input event at a non-zero offset.
  3. Run capture; observe that interactions stay undispatched and stdin is never sent.

Expected

Input and resize events should be dispatchable when they are scheduled by timestamp even if no terminal output has been observed yet, or the behavior should be explicit and configurable.

Impact

  • Reduces fidelity for silent interactive sessions.
  • Can miss intended workflow reproduction when the target process has no readiness prompt/output.

Proposed fix

  • Remove output-readiness gating or gate only resize signals as needed.
  • Alternatively, expose a per-scenario readiness policy (output_first/immediate/ready_timeout).
  • Add a regression test for a scenario where first output is absent but an input event is required.
Originally created by @morluto on GitHub (Jul 14, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/201 ## Environment - Local REA repo - process-capture adapter ## Symptom Interactive process-capture scenarios that only include input and/or resize events are not dispatched when the target process does not emit any terminal output before the first scheduled event. ## Evidence In `startCaptureRuntime`, `startScenarioEvents` is deferred when `eventsRequireReadiness(scenario)` is true: - `eventsRequireReadiness` returns true if any event is `input` or `resize`. - In that case, scenario events are triggered via `onFirstOutput` callback in `captureTerminalFrames`, not immediately. - For PTY targets that produce no output before waiting for stdin (for example `/bin/cat`, `read`, many REPLs waiting silently), the `onData` handler may never fire. - As a result, scheduled input/resize events never run, and the capture can terminate on timeout/idle timeout with target interactions never sent. ## Repro scenario 1. Run a capture with an executable that is interactive but outputs nothing before first input (for example, a scenario invoking `/bin/cat`). 2. Add an `input` event at a non-zero offset. 3. Run capture; observe that interactions stay undispatched and stdin is never sent. ## Expected Input and resize events should be dispatchable when they are scheduled by timestamp even if no terminal output has been observed yet, or the behavior should be explicit and configurable. ## Impact - Reduces fidelity for silent interactive sessions. - Can miss intended workflow reproduction when the target process has no readiness prompt/output. ## Proposed fix - Remove output-readiness gating or gate only resize signals as needed. - Alternatively, expose a per-scenario readiness policy (`output_first`/`immediate`/`ready_timeout`). - Add a regression test for a scenario where first output is absent but an input event is required.
bsakaguchi 2026-10-15 18:21:38 +00:00
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#146
No description provided.