Skip to content

fix(browser): distinguish WebMCP registration frame owners - #813

Merged
N0zoM1z0 merged 1 commit into
morluto:mainfrom
rudycelekli:fix/webmcp-frame-registration-identity-20261006
Oct 7, 2026
Merged

N0zoM1z0 merged 1 commit into
morluto:mainfrom
rudycelekli:fix/webmcp-frame-registration-identity-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown

Summary

Keep WebMCP registrations from distinct observed frames separate, including when their names and URLs match.

Problem and expected behavior

Two ordinary same-origin iframes serving the same URL can each register read_item. Actual Chrome154 emits two registrations with distinct frame IDs, but REA hashes only URL/name, retains one, and reports a complete inventory. Unregistering the retained second owner leaves the first registered in Chrome but REA returns zero. Passive discovery should retain both owners and remove only the requested owner. This is a reproduced ordinary bug fix, not a large contract change requiring an issue.

Change and scope

Include the observed frame ID in the registration identity. Same-frame updates retain one entry; updates and removals do not overwrite a different frame owner. Preserve current origin/frame admission, metadata parsing, and passive discovery. Owning docs explain that this key is not a stable identity across navigation or browser sessions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: browser WebMCP registration normalization.
  • CLI and MCP/tool-catalog contract: same schemas and passive tool; registration keys now include observed frame ownership.
  • Provider, bridge, target-format, or platform compatibility: experimental Chrome CDP WebMCP inventory.
  • Evidence, artifact, provenance, or reconstruction contract: preserve separate observed registrations; no synthetic declarations or invocation.
  • Process execution, authorization, cleanup, or containment impact: none; existing origin and frame admission unchanged.
  • Generated metadata (docs/product-catalog.json), package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: two existing-fixture protocol controls cover same-URL owners, same-frame updates and owner-specific removal. Both fail the base source;17existing controls pass.

  • Base reproduction or other evidence: actual public CdpBrowserProvider.discoverWebMcpTools, owned HTTP page and Chrome154. A transparent loopback CDP passthrough acknowledges the actual WebMCP.enable response before the external fixture registers tools. Traffic is forwarded unchanged; no synthetic protocol events. Independent native CDP events and document.modelContext.getTools() confirm the real registrations.

  • User-visible CLI/MCP output: the two-frame inventory reports2instead of1; unregistering the second leaves1instead of0. The single-frame control remains1.

  • Remaining proof gaps: no cross-browser or cross-navigation key stability claim. Chrome's initial child-frame replay behavior is unchanged; proof covers live registration events during the discovery window. The fixture tests supplement actual native producer evidence.

  • 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

  • Related document/script, capture comparison and browser MCP tests:29passed.
  • npm run check:5tasks passed,129existing warnings and zero errors.
  • npm run check:fast:2tasks passed.
  • npm run docs:check and npm run build:passed.
  • Actual owned Chrome154 passive discovery: single, duplicate-URL two-frame, unregister-second controls passed.
  • Full npm run verify:browser:passed, including existing public CLI/stdio MCP, popup, network, screenshot and script-export workflows. Its existing descendant-run-token mismatch reports process-lineage evidence unavailable; no stronger lineage claim.

Compatibility, safety, and release

  • Breaking changes or migration steps: no schema changes; tool key values now identify observed frame ownership.
  • Real Hopper/Ghidra, browser, or OS coverage: actual Chrome154/macOS only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no admission or invocation changes; owned loopback fixture only. REA does not evaluate or invoke page code. The external test harness registers/unregisters its own fixture tools.

Review checklist

  • 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.

AI-assisted implementation and verification; I reviewed the patch and ran the reported checks.

@N0zoM1z0 N0zoM1z0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head28eeb18ed5. Registration identity now includes the observed frame owner, matching the existing owner-specific removal and frame-navigation cleanup. Same-frame updates still replace one registration; distinct same-URL frames retain separate tools. Parsing, admission and passive authority remain unchanged, and cross-session/navigation key stability is explicitly excluded. Local production build and all19 document/script boundary tests passed, including both owner/update/removal regressions. All20 hosted checks are green, including the real-browser lane. No blocking findings.

@N0zoM1z0
N0zoM1z0 merged commit b3b44d8 into morluto:main Oct 7, 2026
20 checks passed
@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for your work on “fix(browser): distinguish WebMCP registration frame owners.” I appreciate your contribution to REA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants