[GH-ISSUE #5364] [Bug] Cancelling browser scenario startup becomes unreadable_output and drops partial capture #3257

Closed
opened 2026-10-31 00:38:28 +00:00 by bsakaguchi · 0 comments
Owner

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

Before submitting

  • I searched open and closed reports, including #4356, #4358, #4403 and the active PRs.
  • I removed credentials and sensitive target data.

Area

Process capture or runtime observation.

Observed behavior

Cancelling capture-browser-scenario while the initial navigation is pending exits with status 130 but returns code: "unreadable_output", discarding the retained partial capture:

{"code":"unreadable_output","category":"execution_failure","details":{"operation":"capture_browser_scenario","reason":"Browser scenario provider retained a malformed completed capture."}}

This was observed through the built CLI with real Google Chrome, twice: SIGINT 100 ms after the fixture saw the pending navigation, and after waiting 65 seconds at the same boundary. Neither run needed the external watchdog. The temporary browser profile was removed; no current process command line referenced the unique fixture directory after settlement.

Reproduction

  1. Build the source CLI with the pinned toolchain and select an already-installed Chrome executable.

  2. Serve a local /start page containing:

    <p>start</p><script>setTimeout(()=>{location.href="/away"},0)</script><img src="/slow.png">
    

    Keep both /away and /slow.png requests open without answering.

  3. Run node scripts/rea.mjs capture-browser-scenario request.json --json, using:

    {"browser":{"mode":"launch","executable_path":"/absolute/path/to/chrome"},"start_url":{"url":"http://127.0.0.1:<fixture-port>/start"},"actions":[{"step_id":"settle","action":"wait_for_timeout","duration_ms":1}],"capture":{"at_end":["url"]}}
    
  4. After the fixture receives /away, send SIGINT to the CLI child. The executed short control waited 100 ms after that request, rather than guessing from dispatch time. Read stdout and exit status.

Expected behavior

Keep typed cancellation and the provider's incomplete observation, without promoting it into completed Evidence. The retained-data type deliberately permits missing completeness and unfinished steps.

Impact and scope

The caller receives non-retryable output-corruption advice instead of cancellation and loses available cleanup/observation facts. Observed on one macOS arm64 host with an authored local page. MCP cancellation delivery, Linux, Windows, and frequency on ordinary sites are unverified.

REA version

Built main 71ae02c6efceb6b59e703c0c4e7367d7ea8c6c03, package 6.7.0, with unrelated local changes. The scenario session/provider, capture schema and application service files were identical to that commit.

Runtime and platform

Node 24.18.0 / npm 11.16.0; macOS 26.3 (Darwin 25.3.0), arm64; Google Chrome 155.0.8059.84; playwright-core 1.58.2.

Target and artifact context

An authored localhost HTTP fixture and an isolated temporary browser profile; no external site or private artifact.

Interface

CLI.

Earliest failure stage

Transport or result projection.

Relevant output or evidence

The short main control returned unreadable_output, exit 130, with no partial_observation. The same request and SIGINT barrier on existing PR #4357, exact head d5e29aa44f43ef864311100a010a4e9c653485db, returned cancelled, exit 130, retaining kind: "browser-scenario-observation", steps: [], and browser.cleanup: "terminated-owned-process". That isolated PR has package metadata 6.5.0; it is not a merged current-main fix. Its five selected suites passed 39 tests on this host, including CLI and in-memory MCP controls; those tests do not establish real MCP cancellation delivery.

Typed outcome or recovery expected

cancelled, preserving the raw partial capture and confirmed cleanup state. A successful malformed capture must still be rejected.

Analysis or suspected cause

Source-derived: the application service validates a failure partial against the completed-capture schema. Its cancellation-only failure branch replaces the original error when that promotion fails. PR #4357 removes that invalid replacement and preserves completed-success validation. It already owns the fix; no duplicate implementation is proposed.

Additional context

Found while verifying #5266, which concerns the separate unbounded initial navigation. PR #4357 explicitly describes this residual application-boundary defect but has no standalone issue. Earlier #4356/#4358 concern broader completion/ownership work addressed by #4274; this current-main reproduction is narrower.

Current-main recheck

After the workspace advanced, the rebuilt CLI at 799e8265b254e225dc1dabdd25e56f0ab7f86bd3 reproduced the same result with SIGINT 100 ms after /away: unreadable_output, exit 130, no partial capture, no watchdog. Its temporary profile was removed and no process command line referenced the unique fixture directory afterward. The service/session/provider/schema files remain unchanged from the original baseline. The separate current-base consumer run passed 197 tests with one availability skip; this does not establish delivery of cancellation through every MCP client.

Originally created by @morluto on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5364 ## Before submitting - [x] I searched open and closed reports, including #4356, #4358, #4403 and the active PRs. - [x] I removed credentials and sensitive target data. ## Area Process capture or runtime observation. ## Observed behavior Cancelling `capture-browser-scenario` while the initial navigation is pending exits with status 130 but returns `code: "unreadable_output"`, discarding the retained partial capture: ```json {"code":"unreadable_output","category":"execution_failure","details":{"operation":"capture_browser_scenario","reason":"Browser scenario provider retained a malformed completed capture."}} ``` This was observed through the built CLI with real Google Chrome, twice: SIGINT 100 ms after the fixture saw the pending navigation, and after waiting 65 seconds at the same boundary. Neither run needed the external watchdog. The temporary browser profile was removed; no current process command line referenced the unique fixture directory after settlement. ## Reproduction 1. Build the source CLI with the pinned toolchain and select an already-installed Chrome executable. 2. Serve a local `/start` page containing: ```html <p>start</p><script>setTimeout(()=>{location.href="/away"},0)</script><img src="/slow.png"> ``` Keep both `/away` and `/slow.png` requests open without answering. 3. Run `node scripts/rea.mjs capture-browser-scenario request.json --json`, using: ```json {"browser":{"mode":"launch","executable_path":"/absolute/path/to/chrome"},"start_url":{"url":"http://127.0.0.1:<fixture-port>/start"},"actions":[{"step_id":"settle","action":"wait_for_timeout","duration_ms":1}],"capture":{"at_end":["url"]}} ``` 4. After the fixture receives `/away`, send SIGINT to the CLI child. The executed short control waited 100 ms after that request, rather than guessing from dispatch time. Read stdout and exit status. ## Expected behavior Keep typed cancellation and the provider's incomplete observation, without promoting it into completed Evidence. [The retained-data type](https://github.com/morluto/rea/blob/71ae02c6efceb6b59e703c0c4e7367d7ea8c6c03/src/domain/browserScenarioCapture.ts#L116) deliberately permits missing completeness and unfinished steps. ## Impact and scope The caller receives non-retryable output-corruption advice instead of cancellation and loses available cleanup/observation facts. Observed on one macOS arm64 host with an authored local page. MCP cancellation delivery, Linux, Windows, and frequency on ordinary sites are unverified. ## REA version Built main `71ae02c6efceb6b59e703c0c4e7367d7ea8c6c03`, package 6.7.0, with unrelated local changes. The scenario session/provider, capture schema and application service files were identical to that commit. ## Runtime and platform Node 24.18.0 / npm 11.16.0; macOS 26.3 (Darwin 25.3.0), arm64; Google Chrome 155.0.8059.84; playwright-core 1.58.2. ## Target and artifact context An authored localhost HTTP fixture and an isolated temporary browser profile; no external site or private artifact. ## Interface CLI. ## Earliest failure stage Transport or result projection. ## Relevant output or evidence The short main control returned `unreadable_output`, exit 130, with no `partial_observation`. The same request and SIGINT barrier on existing [PR #4357](https://github.com/morluto/rea/pull/4357), exact head `d5e29aa44f43ef864311100a010a4e9c653485db`, returned `cancelled`, exit 130, retaining `kind: "browser-scenario-observation"`, `steps: []`, and `browser.cleanup: "terminated-owned-process"`. That isolated PR has package metadata 6.5.0; it is not a merged current-main fix. Its five selected suites passed 39 tests on this host, including CLI and in-memory MCP controls; those tests do not establish real MCP cancellation delivery. ## Typed outcome or recovery expected `cancelled`, preserving the raw partial capture and confirmed cleanup state. A successful malformed capture must still be rejected. ## Analysis or suspected cause Source-derived: [the application service](https://github.com/morluto/rea/blob/71ae02c6efceb6b59e703c0c4e7367d7ea8c6c03/src/application/BrowserScenarioCaptureService.ts#L39) validates a failure partial against the completed-capture schema. Its cancellation-only failure branch replaces the original error when that promotion fails. PR #4357 removes that invalid replacement and preserves completed-success validation. It already owns the fix; no duplicate implementation is proposed. ## Additional context Found while verifying #5266, which concerns the separate unbounded initial navigation. PR #4357 explicitly describes this residual application-boundary defect but has no standalone issue. Earlier #4356/#4358 concern broader completion/ownership work addressed by #4274; this current-main reproduction is narrower. ## Current-main recheck After the workspace advanced, the rebuilt CLI at `799e8265b254e225dc1dabdd25e56f0ab7f86bd3` reproduced the same result with SIGINT 100 ms after `/away`: `unreadable_output`, exit 130, no partial capture, no watchdog. Its temporary profile was removed and no process command line referenced the unique fixture directory afterward. The service/session/provider/schema files remain unchanged from the original baseline. The separate current-base consumer run passed 197 tests with one availability skip; this does not establish delivery of cancellation through every MCP client.
bsakaguchi 2026-10-31 00:38:28 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
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#3257
No description provided.