[PR #4571] fix(browser): retain runtime CDP cleanup status after retry #6315

Open
opened 2026-10-31 01:13:30 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4571
Author: @Elements2720
Created: 10/16/2026
Status: 🔄 Open

Base: main ← Head: fix/issue-4467-runtime-cleanup


📝 Commits (1)

  • a9fc563 fix(browser): preserve runtime CDP cleanup ownership

📊 Changes

9 files changed (+243 additions, -57 deletions)

View changed files

📝 src/browser/CdpBrowserProvider.ts (+1 -1)
📝 src/browser/CdpElectronProvider.ts (+3 -1)
📝 src/browser/CdpTargetSession.ts (+16 -2)
📝 src/browser/CdpTargetSessionOwner.ts (+44 -16)
📝 src/browser/execution/CdpRuntimeSession.ts (+33 -26)
📝 src/browser/execution/CdpWebRuntimeProvider.ts (+23 -10)
📝 src/browser/providerIdentities.ts (+8 -0)
📝 tests/boundary/browser/cdpProviderCleanupOwnership.test.ts (+4 -0)
📝 tests/boundary/browser/cdpWebRuntime.test.ts (+111 -1)

📄 Description

Summary

This is a follow-up to the browser/Electron portion of #4467 already present on main.

Cleanup ownership flow:

CdpTargetSessionOwner
transport lease
CdpRuntimeSession.close
CdpWebRuntimeProvider
primary / cancellation / partial-observation error

  • Propagate the exact transport lease through runtime cleanup wrappers and later error composition.
  • Normalize non-typed setup failures before composing cleanup diagnostics.
  • Preserve Electron provider identity through shared CDP ownership errors.
  • Add runtime, primary-failure, cancellation, partial-observation, and Electron identity regressions.

Refs #4467

Evidence

  • Before: the runtime regression failed after successful provider retry because the returned error still had cleanupIncomplete: true.
  • After: the direct boundary run passed 5 files / 43 tests.
  • npm run typecheck passed.
  • npm run check:fast passed: typecheck and lint successful.
  • Formatting and git diff --check passed.
  • Full npm test was attempted earlier but stopped before Vitest because this Windows checkout lacks native/windows/build/manifest.json and native/windows/build/rea-windows-x64.node.
  • Coverage uses the repository fake-CDP boundary; no real Chromium/Electron executable was run.

Merge Danger

Door: two-way

The change is limited to CDP runtime cleanup error composition and provider identity attribution. It does not change target ownership, browser/page close authority, or cleanup retry policy.

Blast Radius: CDP-runtime

The main risk is altered diagnostics for runtime cleanup failures and translated primary/cancellation errors; the focused lifecycle suite covers those paths.


🔄 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/4571 **Author:** [@Elements2720](https://github.com/Elements2720) **Created:** 10/16/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/issue-4467-runtime-cleanup` --- ### 📝 Commits (1) - [`a9fc563`](https://github.com/morluto/rea/commit/a9fc56383a9ddc78799b18a7a43104ebd9fd5d4f) fix(browser): preserve runtime CDP cleanup ownership ### 📊 Changes **9 files changed** (+243 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/CdpBrowserProvider.ts` (+1 -1) 📝 `src/browser/CdpElectronProvider.ts` (+3 -1) 📝 `src/browser/CdpTargetSession.ts` (+16 -2) 📝 `src/browser/CdpTargetSessionOwner.ts` (+44 -16) 📝 `src/browser/execution/CdpRuntimeSession.ts` (+33 -26) 📝 `src/browser/execution/CdpWebRuntimeProvider.ts` (+23 -10) 📝 `src/browser/providerIdentities.ts` (+8 -0) 📝 `tests/boundary/browser/cdpProviderCleanupOwnership.test.ts` (+4 -0) 📝 `tests/boundary/browser/cdpWebRuntime.test.ts` (+111 -1) </details> ### 📄 Description ## Summary This is a follow-up to the browser/Electron portion of #4467 already present on `main`. Cleanup ownership flow: CdpTargetSessionOwner transport lease CdpRuntimeSession.close CdpWebRuntimeProvider primary / cancellation / partial-observation error - Propagate the exact transport lease through runtime cleanup wrappers and later error composition. - Normalize non-typed setup failures before composing cleanup diagnostics. - Preserve Electron provider identity through shared CDP ownership errors. - Add runtime, primary-failure, cancellation, partial-observation, and Electron identity regressions. Refs #4467 ## Evidence - **Before:** the runtime regression failed after successful provider retry because the returned error still had `cleanupIncomplete: true`. - **After:** the direct boundary run passed **5 files / 43 tests**. - `npm run typecheck` passed. - `npm run check:fast` passed: typecheck and lint successful. - Formatting and `git diff --check` passed. - Full `npm test` was attempted earlier but stopped before Vitest because this Windows checkout lacks `native/windows/build/manifest.json` and `native/windows/build/rea-windows-x64.node`. - Coverage uses the repository fake-CDP boundary; no real Chromium/Electron executable was run. ## Merge Danger **Door:** two-way The change is limited to CDP runtime cleanup error composition and provider identity attribution. It does not change target ownership, browser/page close authority, or cleanup retry policy. **Blast Radius:** CDP-runtime The main risk is altered diagnostics for runtime cleanup failures and translated primary/cancellation errors; the focused lifecycle suite covers those paths. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#6315
No description provided.