[PR #838] [MERGED] fix(mcp): isolate optional observation adapter failures #2276

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/838
Author: @N0zoM1z0
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/optional-provider-isolation


📝 Commits (1)

  • d9852d0 fix(mcp): isolate optional observation adapter failures

📊 Changes

31 files changed (+741 additions, -102 deletions)

View changed files

📝 .oxlintrc.json (+3 -1)
📝 docs/capability-migration.md (+24 -0)
📝 src/application/CapabilityInventory.ts (+28 -0)
➕ src/application/OptionalObservationProviders.ts (+43 -0)
📝 src/browser/CdpBrowserProvider.ts (+2 -5)
📝 src/browser/CdpElectronProvider.ts (+2 -5)
📝 src/browser/PlaywrightBrowserScenarioProvider.ts (+2 -6)
📝 src/browser/PlaywrightElectronActiveProvider.ts (+2 -6)
📝 src/browser/V8InspectorProvider.ts (+2 -5)
➕ src/browser/providerIdentities.ts (+38 -0)
📝 src/cli/electronCommands.ts (+7 -12)
📝 src/cliBrowserContext.ts (+4 -2)
📝 src/cliBrowserScenarioCommands.ts (+2 -2)
📝 src/cliJavaScriptRuntimeCommands.ts (+4 -2)
➕ src/composition/browserObservation.ts (+6 -0)
➕ src/composition/browserScenario.ts (+6 -0)
➕ src/composition/electronObservation.ts (+6 -0)
➕ src/composition/electronScenario.ts (+6 -0)
➕ src/composition/javascriptRuntimeObservation.ts (+6 -0)
➕ src/composition/optionalObservationProviders.ts (+97 -0)

...and 11 more files

📄 Description

MCP startup currently discards every optional observation port when any one of its five imports fails. Load the existing typed factories independently, retain healthy peers and report each failed adapter through session availability and the existing capability-unavailable error. The complete 126-tool catalog remains advertised. Actual load failures override configured availability; passive Electron, active Electron and the independent static JS workflows remain separate.

Share five production factories between CLI and MCP without acquiring engines at registration. CLI Electron commands dynamically load only their selected runtime factory. Keep source identities readable without importing the optional implementations and extend the adapter-construction import guard. This is concrete wiring for existing ports, not a universal provider contract or plugin manifest.

Refs #740 (T3 optional factory pilot and T4 failure isolation; the roadmap remains open).

Verification:

  • Focused production-startup/SDK fault injection: each of five adapters failed independently and all optional adapters failed together. Healthy handler calls retain Evidence; static JS and reconciliation execute during Electron failure; malformed input remains validation failure.
  • 30 startup/guard/isolation cases and a subsequent 33 cases across eight files passed, including existing browser, browser scenario, Electron, Inspector, availability and SDK schema tests.
  • Related browser, Electron and Inspector CLI boundary tests passed.
  • npm run check, npm run verify:test-discovery (483 files exactly once), and npm run docs:check passed. Public schemas and generated catalog metadata are unchanged.
  • npm run verify:inspector passed on Linux with eight native Node fixtures through CLI/MCP, including ambiguous and escaped file locations.
  • npm run verify:package passed: installed CLI/MCP, full catalog, target-free startup, lifecycle and isolated setup.

Real browser/Electron, Hopper and Ghidra verification was not run locally. Recording ports establish composition behavior; the real Inspector lane establishes its narrower runtime claim. Existing engines, process limits and provider cleanup authority are unchanged.


🔄 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/838 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/optional-provider-isolation` --- ### 📝 Commits (1) - [`d9852d0`](https://github.com/morluto/rea/commit/d9852d0e089afafd837b891033a656a06a650e7b) fix(mcp): isolate optional observation adapter failures ### 📊 Changes **31 files changed** (+741 additions, -102 deletions) <details> <summary>View changed files</summary> 📝 `.oxlintrc.json` (+3 -1) 📝 `docs/capability-migration.md` (+24 -0) 📝 `src/application/CapabilityInventory.ts` (+28 -0) ➕ `src/application/OptionalObservationProviders.ts` (+43 -0) 📝 `src/browser/CdpBrowserProvider.ts` (+2 -5) 📝 `src/browser/CdpElectronProvider.ts` (+2 -5) 📝 `src/browser/PlaywrightBrowserScenarioProvider.ts` (+2 -6) 📝 `src/browser/PlaywrightElectronActiveProvider.ts` (+2 -6) 📝 `src/browser/V8InspectorProvider.ts` (+2 -5) ➕ `src/browser/providerIdentities.ts` (+38 -0) 📝 `src/cli/electronCommands.ts` (+7 -12) 📝 `src/cliBrowserContext.ts` (+4 -2) 📝 `src/cliBrowserScenarioCommands.ts` (+2 -2) 📝 `src/cliJavaScriptRuntimeCommands.ts` (+4 -2) ➕ `src/composition/browserObservation.ts` (+6 -0) ➕ `src/composition/browserScenario.ts` (+6 -0) ➕ `src/composition/electronObservation.ts` (+6 -0) ➕ `src/composition/electronScenario.ts` (+6 -0) ➕ `src/composition/javascriptRuntimeObservation.ts` (+6 -0) ➕ `src/composition/optionalObservationProviders.ts` (+97 -0) _...and 11 more files_ </details> ### 📄 Description MCP startup currently discards every optional observation port when any one of its five imports fails. Load the existing typed factories independently, retain healthy peers and report each failed adapter through session availability and the existing capability-unavailable error. The complete 126-tool catalog remains advertised. Actual load failures override configured availability; passive Electron, active Electron and the independent static JS workflows remain separate. Share five production factories between CLI and MCP without acquiring engines at registration. CLI Electron commands dynamically load only their selected runtime factory. Keep source identities readable without importing the optional implementations and extend the adapter-construction import guard. This is concrete wiring for existing ports, not a universal provider contract or plugin manifest. Refs #740 (T3 optional factory pilot and T4 failure isolation; the roadmap remains open). Verification: - Focused production-startup/SDK fault injection: each of five adapters failed independently and all optional adapters failed together. Healthy handler calls retain Evidence; static JS and reconciliation execute during Electron failure; malformed input remains validation failure. - 30 startup/guard/isolation cases and a subsequent 33 cases across eight files passed, including existing browser, browser scenario, Electron, Inspector, availability and SDK schema tests. - Related browser, Electron and Inspector CLI boundary tests passed. - `npm run check`, `npm run verify:test-discovery` (483 files exactly once), and `npm run docs:check` passed. Public schemas and generated catalog metadata are unchanged. - `npm run verify:inspector` passed on Linux with eight native Node fixtures through CLI/MCP, including ambiguous and escaped file locations. - `npm run verify:package` passed: installed CLI/MCP, full catalog, target-free startup, lifecycle and isolated setup. Real browser/Electron, Hopper and Ghidra verification was not run locally. Recording ports establish composition behavior; the real Inspector lane establishes its narrower runtime claim. Existing engines, process limits and provider cleanup authority are unchanged. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:16: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#2276
No description provided.