Reject registerTool on already-aborted signal (Chrome 152); sweep stale navigator.modelContext references#27
Open
kashishhora wants to merge 1 commit into
Open
Reject registerTool on already-aborted signal (Chrome 152); sweep stale navigator.modelContext references#27kashishhora wants to merge 1 commit into
kashishhora wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
navigator.modelContextis now fully removed (deprecated since 150; this library migrated todocument.modelContextin 0.2.0 / Migrate WebMCP surface to document.modelContext (Promise registration, single-arg execute) #23).registerToolnow rejects with the signal's abort reason when handed an already-abortedAbortSignal— 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.ts—registerToolwith an already-aborted signal now rejects withsignal.reasoninstead 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.useMcpToolneeds no change: it never passes a pre-aborted signal, andAbortErrorrejections are already treated as lifecycle teardown.Doc/metadata sweep
navigator.modelContext→document.modelContext; the project-structure line now correctly says content-main.ts readsnavigator.modelContextTesting. Privacy policy date bumped.navigator.modelContext→document.modelContext.Reviewer notes
pnpm typecheck,pnpm test(174 tests, 11 files),pnpm lintall pass.