[PR #7188] [MERGED] fix(browser): preserve external defaults during CDP attachment #7703

Closed
opened 2026-11-03 13:39:46 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7188
Author: @akushonkamen
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/7167-connect-mode-scenario


📝 Commits (10+)

  • 5736bd9 fix(browser): recover attached scenario capture when Chromium restricts context management
  • 60daca4 refactor(reconstruction): share canonical original cases across evaluation
  • 7ccecbc refactor(cdp): centralize execution context identity parsing
  • 991a240 fix(cli): preserve script export evidence through shared finalization
  • 941838f refactor(elf): centralize fixed header type and flags decoding
  • 634e566 refactor(capabilities): remove inert client requirement facade
  • 071a637 refactor(cli): share managed comparison finalization
  • 7439d0d refactor(artifacts): reuse Mach-O framing for Node SEA discovery
  • 5e581fd refactor(workflows): share source caveat grouping identity
  • f6d9f1b refactor(browser): reuse worker URL exclusion classification

📊 Changes

1072 files changed (+53538 additions, -12966 deletions)

View changed files

📝 .agents/skills/rea-analysis-optimization/SKILL.md (+5 -0)
📝 .agents/skills/reverse-engineer-anything/references/javascript-applications.md (+9 -0)
📝 .agents/skills/reverse-engineer-anything/references/native-and-artifacts.md (+14 -0)
📝 .github/workflows/ci.yml (+4 -0)
📝 AGENTS.md (+6 -3)
📝 README.md (+6 -0)
📝 SECURITY.md (+1 -1)
📝 bridge/ghidra/ReaGhidraBridge.java (+18 -6)
📝 docs/agent-environments.md (+14 -6)
📝 docs/browser-scenario-contract.md (+6 -0)
📝 docs/cli.md (+30 -5)
📝 docs/client-configuration.md (+36 -9)
📝 docs/desktop-applications.md (+1 -1)
📝 docs/error-contract.schema.json (+2 -6)
📝 docs/firmware-analysis.md (+1 -1)
📝 docs/ghidra-dos.md (+1 -1)
📝 docs/installation.md (+85 -10)
📝 docs/javascript-route-inventory.md (+36 -4)
📝 docs/kuna-provider.md (+5 -1)
📝 docs/mcp-contracts.md (+112 -14)

...and 80 more files

📄 Description

Summary

Refs #7167. Fix independently reproduced CDP attachment defects: implicit default-context initialization can reject a macOS headful zero-page endpoint, and connecting a scenario changes media on an unrelated external page.

Attach once with the public noDefaults option, pinned to playwright-core 1.64.1. Remove the bootstrap-page/retry helper. The selected page's existing environment owner applies temporary focus for background actions, awaits late acquisition, clears its override and retains failed cleanup for retry. CLI/MCP keep their shared Evidence and timeout contracts.

The real MCP regression independently reads an unselected page through raw CDP during the existing page-controlled gate, with exact page-ID and environment/language cleanup assertions. Fixture layout settles before the baseline. Two SDK fixtures adopt the disposable return shape. The npm archive SHA-512 is verified and all six upstream license/notice texts are retained.

Issue-start main 476797010; reviewed head 9cb63fd1d13b1c7e8c538cf7ea95910e6991a370. CI tested merge 7a8b4b2 against newer main 52414282b.

Validation

  • 148 local source tests pass, including late focus success, cleanup retry, cancellation and module fixtures. Typecheck/lint, formatting, license and docs checks pass (nine docs consistency cases).
  • Actual Linux Chrome156: final unselected-media oracle fails on exact main476 and passes with the fix through the complete CLI/MCP environment workflow. Changing an irrelevant initial page title also passes. Background selected-page actions, queued cancellation, failed initialization/action cleanup, language, viewport and exact page IDs are verified.
  • Full real-browser CI passes on Chrome155 in job121867169483, including the new oracle, CLI/MCP network/storage/service-worker flows, module loading, screenshots and verified empty descendant lineage.
  • Actual macOS15 arm64 /official Chrome156.0.8078.4: source-pinned run40406207460 checks out9cb and passes the complete CLI/MCP environment workflow. The production-owner zero-page probes return target_not_found in headful/headless modes with zero pages and zero cleanup failures. Earlier control40400623644 reproduces the context-management refusal with both old/new default SDK connections; noDefaults connects successfully.
  • **CI40406214879 finished:**34 jobs pass, two policy skips. Linux shard6 and Windows curated tests fail the same empty-Java-bitness detail assertion; two aggregate gates fail consequently. The exact CI main base524 reproduces the assertion locally (one failed/eight filtered), independently of this PR. Three fail-fast-canceled shards remain unverified; Windows package verification after the curated tests did not run. No Windows Chrome claim.
  • Codex reviewed9cb with no findings. Greptile gives4/5 with one updater-process finding outside the PR: UpdateCommandRunner.ts is identical blobbcaf7e77... on issue-start main, PRhead, CIbase and CImerge. Producer/consumer scope evidence is in the reply; all threads are resolved. No unrelated updater refactor is included.

Limits and cost

The reporter's private logged-in target/generic-error narrative is not fully reproduced, so this PR references the issue rather than closing it. The isolated-HOME8s startup probe fails on both baseline and candidate (navigation versus handshake timeout); the candidate retains browser_transport cleanup instead of claiming completion. Temporary native diagnostic workflows are isolated and never merged.

Local heavy work uses two CPUs and family memory guards. Completed Linux environment check:10.569s wall/12.375s CPU/2129.55MiB sampled family peak; title control:20.554/22.936/2096. Mac environment:18.02/16.87,407.88MiB maximum single-process RSS (family peak unmeasured). Static checks peak3795.04MiB. Sampling can double-count shared pages or miss short peaks. Agent/schema tokens and a controlled latency speedup are unmeasured.

A local multi-file source-boundary batch hit3.5GiB; a one-file VM/import profile reached90s; the broad browser run stopped at240s after popup coverage. These stopped runs are not passes. Full real-browser CI supplies completed wider coverage; canceled shards above remain a gap. Production adds no output fields, catalog work, retained report or cache; the regression reuses the existing MCP analysis gate.

Author readiness

Human owner: @akushonkamen

  • 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/7188 **Author:** [@akushonkamen](https://github.com/akushonkamen) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/7167-connect-mode-scenario` --- ### 📝 Commits (10+) - [`5736bd9`](https://github.com/morluto/rea/commit/5736bd9f9477881d2bdc7ce0a547bd70f9b296d4) fix(browser): recover attached scenario capture when Chromium restricts context management - [`60daca4`](https://github.com/morluto/rea/commit/60daca427d7713479ea4c82c4775ee57b95065aa) refactor(reconstruction): share canonical original cases across evaluation - [`7ccecbc`](https://github.com/morluto/rea/commit/7ccecbcb0048ac760a6fba4d519497bddfcf193f) refactor(cdp): centralize execution context identity parsing - [`991a240`](https://github.com/morluto/rea/commit/991a2406060ae200ee5db260e486e68c1f5bb4bd) fix(cli): preserve script export evidence through shared finalization - [`941838f`](https://github.com/morluto/rea/commit/941838fdd986babaac22a60b9c2c6c9f6ae329c3) refactor(elf): centralize fixed header type and flags decoding - [`634e566`](https://github.com/morluto/rea/commit/634e566c0925f0afed5cef47cc426eb811ad51c5) refactor(capabilities): remove inert client requirement facade - [`071a637`](https://github.com/morluto/rea/commit/071a637a9fd571a7a18e728edbf6929874ecd8ed) refactor(cli): share managed comparison finalization - [`7439d0d`](https://github.com/morluto/rea/commit/7439d0d5d8b21274638a55387e99de4b35795fb8) refactor(artifacts): reuse Mach-O framing for Node SEA discovery - [`5e581fd`](https://github.com/morluto/rea/commit/5e581fd3b12e78a2727c061185bb5c680eb36084) refactor(workflows): share source caveat grouping identity - [`f6d9f1b`](https://github.com/morluto/rea/commit/f6d9f1b05c57c8685637cd9c4acabed2b2883084) refactor(browser): reuse worker URL exclusion classification ### 📊 Changes **1072 files changed** (+53538 additions, -12966 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/rea-analysis-optimization/SKILL.md` (+5 -0) 📝 `.agents/skills/reverse-engineer-anything/references/javascript-applications.md` (+9 -0) 📝 `.agents/skills/reverse-engineer-anything/references/native-and-artifacts.md` (+14 -0) 📝 `.github/workflows/ci.yml` (+4 -0) 📝 `AGENTS.md` (+6 -3) 📝 `README.md` (+6 -0) 📝 `SECURITY.md` (+1 -1) 📝 `bridge/ghidra/ReaGhidraBridge.java` (+18 -6) 📝 `docs/agent-environments.md` (+14 -6) 📝 `docs/browser-scenario-contract.md` (+6 -0) 📝 `docs/cli.md` (+30 -5) 📝 `docs/client-configuration.md` (+36 -9) 📝 `docs/desktop-applications.md` (+1 -1) 📝 `docs/error-contract.schema.json` (+2 -6) 📝 `docs/firmware-analysis.md` (+1 -1) 📝 `docs/ghidra-dos.md` (+1 -1) 📝 `docs/installation.md` (+85 -10) 📝 `docs/javascript-route-inventory.md` (+36 -4) 📝 `docs/kuna-provider.md` (+5 -1) 📝 `docs/mcp-contracts.md` (+112 -14) _...and 80 more files_ </details> ### 📄 Description ## Summary Refs #7167. Fix independently reproduced CDP attachment defects: implicit default-context initialization can reject a macOS headful zero-page endpoint, and connecting a scenario changes media on an unrelated external page. Attach once with the public [`noDefaults` option](https://playwright.dev/docs/api/class-browsertype#browser-type-connect-over-cdp-option-no-defaults), pinned to `playwright-core` 1.64.1. Remove the bootstrap-page/retry helper. The selected page's existing environment owner applies temporary focus for background actions, awaits late acquisition, clears its override and retains failed cleanup for retry. CLI/MCP keep their shared Evidence and timeout contracts. The real MCP regression independently reads an unselected page through raw CDP during the existing page-controlled gate, with exact page-ID and environment/language cleanup assertions. Fixture layout settles before the baseline. Two SDK fixtures adopt the disposable return shape. The npm archive SHA-512 is verified and all six upstream license/notice texts are retained. Issue-start main `476797010`; reviewed head `9cb63fd1d13b1c7e8c538cf7ea95910e6991a370`. CI tested merge `7a8b4b2` against newer main `52414282b`. ## Validation - **148 local source tests pass**, including late focus success, cleanup retry, cancellation and module fixtures. Typecheck/lint, formatting, license and docs checks pass (nine docs consistency cases). - **Actual Linux Chrome156:** final unselected-media oracle fails on exact main476 and passes with the fix through the complete CLI/MCP environment workflow. Changing an irrelevant initial page title also passes. Background selected-page actions, queued cancellation, failed initialization/action cleanup, language, viewport and exact page IDs are verified. - **Full real-browser CI passes** on Chrome155 in [job121867169483](https://github.com/morluto/rea/actions/runs/40406214879/job/121867169483), including the new oracle, CLI/MCP network/storage/service-worker flows, module loading, screenshots and verified empty descendant lineage. - **Actual macOS15 arm64 /official Chrome156.0.8078.4:** [source-pinned run40406207460](https://github.com/morluto/rea/actions/runs/40406207460) checks out9cb and passes the complete CLI/MCP environment workflow. The production-owner zero-page probes return `target_not_found` in headful/headless modes with zero pages and zero cleanup failures. Earlier [control40400623644](https://github.com/morluto/rea/actions/runs/40400623644) reproduces the context-management refusal with both old/new default SDK connections; `noDefaults` connects successfully. - **CI40406214879 finished:**34 jobs pass, two policy skips. Linux shard6 and Windows curated tests fail the same empty-Java-bitness detail assertion; two aggregate gates fail consequently. The exact CI main base524 reproduces the assertion locally (one failed/eight filtered), independently of this PR. Three fail-fast-canceled shards remain unverified; Windows package verification after the curated tests did not run. No Windows Chrome claim. - Codex reviewed9cb with no findings. Greptile gives4/5 with one updater-process finding outside the PR: `UpdateCommandRunner.ts` is identical blob`bcaf7e77...` on issue-start main, PRhead, CIbase and CImerge. Producer/consumer scope evidence is in the reply; all threads are resolved. No unrelated updater refactor is included. ## Limits and cost The reporter's private logged-in target/generic-error narrative is not fully reproduced, so this PR references the issue rather than closing it. The isolated-HOME8s startup probe fails on both baseline and candidate (navigation versus handshake timeout); the candidate retains `browser_transport` cleanup instead of claiming completion. Temporary native diagnostic workflows are isolated and never merged. Local heavy work uses two CPUs and family memory guards. Completed Linux environment check:10.569s wall/12.375s CPU/2129.55MiB sampled family peak; title control:20.554/22.936/2096. Mac environment:18.02/16.87,407.88MiB maximum single-process RSS (family peak unmeasured). Static checks peak3795.04MiB. Sampling can double-count shared pages or miss short peaks. Agent/schema tokens and a controlled latency speedup are unmeasured. A local multi-file source-boundary batch hit3.5GiB; a one-file VM/import profile reached90s; the broad browser run stopped at240s after popup coverage. These stopped runs are not passes. Full real-browser CI supplies completed wider coverage; canceled shards above remain a gap. Production adds no output fields, catalog work, retained report or cache; the regression reuses the existing MCP analysis gate. ## Author readiness Human owner: @akushonkamen - [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. - [x] 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-03 13:39:46 +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#7703
No description provided.