Skip to content

Reject registerTool on already-aborted signal (Chrome 152); sweep stale navigator.modelContext references#27

Open
kashishhora wants to merge 1 commit into
mainfrom
chrome-152-updates
Open

Reject registerTool on already-aborted signal (Chrome 152); sweep stale navigator.modelContext references#27
kashishhora wants to merge 1 commit into
mainfrom
chrome-152-updates

Conversation

@kashishhora

Copy link
Copy Markdown
Member

What changed

Chrome 152.0.7943.0 shipped two relevant changes (per the Chrome WebMCP team's EPP announcement and verified against Chromium source at the 152.0.7943.0 tag):

  1. navigator.modelContext is now fully removed (deprecated since 150; this library migrated to document.modelContext in 0.2.0 / Migrate WebMCP surface to document.modelContext (Promise registration, single-arg execute) #23).
  2. Native registerTool now rejects with the signal's abort reason when handed an already-aborted AbortSignal — the behavior specified by webmcp spec PR #202 (merged June 17), which had not shipped as of Chrome 151. Our docs carried a "revisit if native changes" caveat for exactly this.

Behavior change

  • src/polyfill/registry.tsregisterTool with an already-aborted signal now rejects with signal.reason instead of resolving as a no-op. The check stays after validation, matching the spec's step order (validation errors take precedence).
  • src/polyfill/__tests__/registry.test.ts — test flipped to assert rejection with the exact abort reason.
  • useMcpTool needs no change: it never passes a pre-aborted signal, and AbortError rejections are already treated as lifecycle teardown.

Doc/metadata sweep

  • extension/README.md, extension/PRIVACY.mdnavigator.modelContextdocument.modelContext; the project-structure line now correctly says content-main.ts reads navigator.modelContextTesting. Privacy policy date bumped.
  • package.json — npm keyword navigator.modelContextdocument.modelContext.
  • docs/api.md — aborted-signal paragraph rewritten; "revisit if native changes" caveat resolved.
  • examples/native-harness/src/App.tsx — the "open spec question" probe comment is settled; rejection now logs PASS, resolve logs INFO (pre-152 native).
  • src/hooks/useMcpTool.ts — comment notes native 152+ returns a Promise.
  • CHANGELOG.md — new Unreleased section. (0.2.0 entries left as accurate history.)

Reviewer notes

  • The aborted-signal change is observable behavior of the published polyfill (no-op → rejection), so it warrants a version bump on release.
  • Verified: pnpm typecheck, pnpm test (174 tests, 11 files), pnpm lint all pass.

…modelContext docs

Chrome 152.0.7943.0 removed navigator.modelContext and shipped the
WebMCP spec PR #202 behavior: registerTool rejects with the signal's
abort reason when the signal is already aborted (previously a no-op,
matching Chrome 151).

- polyfill registry: reject with signal.reason after validation,
  matching spec step order and native Chrome 152
- docs/api.md: aborted-signal paragraph rewritten; the "revisit if
  native changes" caveat is resolved
- native-harness probe: spec question is settled — rejection logs PASS
- extension README/PRIVACY, package.json keywords: document.modelContext
- CHANGELOG: Unreleased section covering both changes
@kashishhora
kashishhora requested a review from naji247 July 22, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant