[PR #5285] [CLOSED] fix(browser): bound initial navigation when command_timeout_ms is omitted #6858

Closed
opened 2026-11-01 21:43:34 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5285
Author: @sx4im
Created: 10/19/2026
Status: ❌ Closed

Base: main ← Head: fix/5266-browser-start-navigation-deadline


📝 Commits (2)

  • e5c85fc fix(browser): bound initial navigation when command_timeout_ms is omitted
  • 0afbeb4 Merge upstream main into rework branch

📊 Changes

2 files changed (+31 additions, -1 deletions)

View changed files

📝 src/browser/PlaywrightScenarioSession.test.ts (+29 -0)
📝 src/browser/PlaywrightScenarioSession.ts (+2 -1)

📄 Description

Summary

Fixes #5266. Main already bounds the start navigation through scenario.command_timeout_ms when the field is set (5cded74b). When a scenario omits the field, the value stayed undefined all the way to the execution boundary, and undefined there means no deadline. This change resolves the omitted case through the existing default helper, so the documented 20000 ms bound applies.

This PR was reworked after 5cded74b landed: its original provider-owned-deadline design is superseded by main, and the branch now carries only the case that design left open.

Problem and expected behavior

PlaywrightScenarioSession.open() passed scenario.command_timeout_ms straight to withPlaywrightExecutionBoundary. The schema field is optional, so a scenario that omits it produces undefined. The boundary treats undefined as no deadline, while page.goto runs with timeout: 0. The start navigation can then wait without limit, which is the hang #5266 reports.

The contract already promises otherwise. docs/browser-scenario-contract.md and the schema description both say an omitted command_timeout_ms means 20000. Expected: a scenario that omits the field gets the 20000 ms bound on its start navigation, same as every other consumer of the field.

Change and scope

  • src/browser/PlaywrightScenarioSession.ts: open() now passes selectedCdpCommandTimeoutMs(scenario.command_timeout_ms) to the execution boundary instead of the raw field. selectedCdpCommandTimeoutMs is the helper the other CDP call sites already use; it maps undefined to 20000 and passes set values through.
  • Tests: src/browser/PlaywrightScenarioSession.test.ts gains an it.each case over the launch and connect paths asserting the boundary receives 20000 when the field is omitted.

Scope decision: not applicable. One call site, no new helper, no schema change. Behavior for scenarios that set the field is unchanged.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the browser scenario session open path (PlaywrightScenarioSession), at the point where the start navigation is armed.
  • Contribution scope fit and linked maintainer decision: not applicable (ordinary fix).
  • CLI and MCP/tool-catalog contract: none changed. The result now matches the documented default instead of contradicting it.
  • Provider, bridge, target-format, or platform compatibility: Playwright browser scenario provider only.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: no new authority, no target selection change.
  • Generated metadata, package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added: the it.each launch/connect case in PlaywrightScenarioSession.test.ts described above.
  • Base reproduction: with the fix reverted, the two new cases time out at the 30000 ms test limit, because no deadline reaches the boundary. That is the unbounded wait from #5266, reproduced at the session boundary. With the fix, both pass.
  • User-visible CLI/MCP output: none attached; the change is one resolved value at the session boundary and the tests assert that value directly.
  • Remaining proof gaps: no real browser run. The tests use the existing fake-session setup, which covers the value handed to the execution boundary; the boundary and page.goto behavior past that point is unchanged by this PR.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Re-verified on the merged tree (head 0afbeb44, main tip aa79f59):

  • npx vitest run src/browser/PlaywrightScenarioSession.test.ts: 46 passed.
  • npx vitest run src/domain/browserScenario.test.ts: 9 passed.
  • npm run check:fast on the merged tree stops at deps:check (oxlint-tsgolint missing from the installed lockfile) before typecheck/lint; that is an environment/lockfile staleness issue, not a failure in this diff, and the two touched files pass the session tests above.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Scenarios that set command_timeout_ms behave as before; scenarios that omit it now get the bound the docs already describe.
  • Real Hopper/Ghidra, browser, or OS coverage: none; fake-session tests only, see proof gaps above.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; no new authority, network, or process behavior.

Author readiness

Human owner: @sx4im

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5285 **Author:** [@sx4im](https://github.com/sx4im) **Created:** 10/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/5266-browser-start-navigation-deadline` --- ### 📝 Commits (2) - [`e5c85fc`](https://github.com/morluto/rea/commit/e5c85fc7efb646a07041aee80fe8af41b4dfd8f3) fix(browser): bound initial navigation when command_timeout_ms is omitted - [`0afbeb4`](https://github.com/morluto/rea/commit/0afbeb44ab58d6f1175647caa041cad3f55a75b5) Merge upstream main into rework branch ### 📊 Changes **2 files changed** (+31 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/PlaywrightScenarioSession.test.ts` (+29 -0) 📝 `src/browser/PlaywrightScenarioSession.ts` (+2 -1) </details> ### 📄 Description ## Summary Fixes #5266. Main already bounds the start navigation through `scenario.command_timeout_ms` when the field is set (5cded74b). When a scenario omits the field, the value stayed undefined all the way to the execution boundary, and undefined there means no deadline. This change resolves the omitted case through the existing default helper, so the documented 20000 ms bound applies. This PR was reworked after 5cded74b landed: its original provider-owned-deadline design is superseded by main, and the branch now carries only the case that design left open. ## Problem and expected behavior `PlaywrightScenarioSession.open()` passed `scenario.command_timeout_ms` straight to `withPlaywrightExecutionBoundary`. The schema field is optional, so a scenario that omits it produces undefined. The boundary treats undefined as no deadline, while `page.goto` runs with `timeout: 0`. The start navigation can then wait without limit, which is the hang #5266 reports. The contract already promises otherwise. `docs/browser-scenario-contract.md` and the schema description both say an omitted `command_timeout_ms` means 20000. Expected: a scenario that omits the field gets the 20000 ms bound on its start navigation, same as every other consumer of the field. ## Change and scope - `src/browser/PlaywrightScenarioSession.ts`: `open()` now passes `selectedCdpCommandTimeoutMs(scenario.command_timeout_ms)` to the execution boundary instead of the raw field. `selectedCdpCommandTimeoutMs` is the helper the other CDP call sites already use; it maps undefined to 20000 and passes set values through. - Tests: `src/browser/PlaywrightScenarioSession.test.ts` gains an `it.each` case over the launch and connect paths asserting the boundary receives 20000 when the field is omitted. Scope decision: not applicable. One call site, no new helper, no schema change. Behavior for scenarios that set the field is unchanged. ## Contract and boundary impact - Semantic owner and earliest changed stage: the browser scenario session open path (`PlaywrightScenarioSession`), at the point where the start navigation is armed. - Contribution scope fit and linked maintainer decision: not applicable (ordinary fix). - CLI and MCP/tool-catalog contract: none changed. The result now matches the documented default instead of contradicting it. - Provider, bridge, target-format, or platform compatibility: Playwright browser scenario provider only. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details: no new authority, no target selection change. - Generated metadata, package, or installation impact: none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added: the `it.each` launch/connect case in `PlaywrightScenarioSession.test.ts` described above. - Base reproduction: with the fix reverted, the two new cases time out at the 30000 ms test limit, because no deadline reaches the boundary. That is the unbounded wait from #5266, reproduced at the session boundary. With the fix, both pass. - User-visible CLI/MCP output: none attached; the change is one resolved value at the session boundary and the tests assert that value directly. - Remaining proof gaps: no real browser run. The tests use the existing fake-session setup, which covers the value handed to the execution boundary; the boundary and `page.goto` behavior past that point is unchanged by this PR. For evidence-bearing changes: - [ ] Observed, derived, and inferred claims remain distinguishable. - [ ] Artifact identity, source provenance, and failed attempts remain preserved. - [ ] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Re-verified on the merged tree (head 0afbeb44, main tip aa79f59): - `npx vitest run src/browser/PlaywrightScenarioSession.test.ts`: 46 passed. - `npx vitest run src/domain/browserScenario.test.ts`: 9 passed. - `npm run check:fast` on the merged tree stops at `deps:check` (oxlint-tsgolint missing from the installed lockfile) before typecheck/lint; that is an environment/lockfile staleness issue, not a failure in this diff, and the two touched files pass the session tests above. ## Compatibility, safety, and release - Breaking changes or migration steps: none. Scenarios that set `command_timeout_ms` behave as before; scenarios that omit it now get the bound the docs already describe. - Real Hopper/Ghidra, browser, or OS coverage: none; fake-session tests only, see proof gaps above. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none; no new authority, network, or process behavior. ## Author readiness Human owner: @sx4im - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:43:34 +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#6858
No description provided.