Skip to content

fix: never register a tool twice, even across library copies (0.2.1) - #3

Merged
ralyodio merged 1 commit into
masterfrom
fix/single-load
Nov 11, 2026
Merged

ralyodio merged 1 commit into
masterfrom
fix/single-load

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor
  • Registry of registered names on the ModelContext under Symbol.for('@profullstack/webmcp.registered'), so every copy of the library (site tag + stats.js plugin, @0 + pinned) sees it; a duplicate is skipped silently and its no-op unregister cannot remove the original.
  • Abort during a pending registerTool unregisters (StrictMode leak).
  • The embed already exits if window.ProfullstackWebMCP exists.

Tests 16/16.

🤖 Generated with Claude Code

Page-wide registry keyed by Symbol.for on the ModelContext, shared by every
copy of the module (site tag + crawlproof stats.js plugin, @0 + pinned).
Abort during a pending registerTool now unregisters (React StrictMode).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 926ac52 into master Nov 11, 2026
1 check passed
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