Repository navigation
fix(webmcp): handle the breaking change to tool registration identity - #3540
Merged
seanmcguire12 merged 1 commit intoNov 24, 2026
Conversation
🦋 Changeset detectedLatest commit: 2f51d59 The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
vishalanton16
marked this pull request as ready for review
November 24, 2026 15:02
seanmcguire12
changed the base branch from
main
to
external/vishalanton16-webmcp-tool-interface
November 24, 2026 19:46
seanmcguire12
merged commit Nov 24, 2026
2568de1
into
browserbase:external/vishalanton16-webmcp-tool-interface
5 checks passed
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.
Why
A website can replace a tool and give the new tool the same name. If Stagehand calls a tool it found earlier using only that name, it can accidentally run the replacement. Chrome now gives each registration its own ID. WebMCP PR #348
What
Stagehand uses that ID in TypeScript and Python to call the exact tool it found. If the website has removed it, the call fails. Older Chrome versions still look up tools by name.
How
Verified on Chrome 158 and Chrome Dev 160 with both SDKs. On the WebMCP groceries demo, save the
get_storeshandle, navigate away, then return. On Chrome Dev 160, the saved handle should fail and a freshly discovered handle should return the stores.Summary by cubic
Keeps saved WebMCP tool handles pointing at their original registration so a page that reuses a tool name can't redirect a previously discovered handle to a replacement tool. Chrome now assigns every registration a
toolId; Stagehand passes it through in TypeScript and Python when Chrome supports it, and falls back to name-based lookup on older versions.toolIdto tool descriptors, identities, and the protocol.toolIdwhen available; old handles now fail cleanly if the registration was removed.toolIdin discovery and event payloads.devtools-protocolto pick up the new WebMCP definitions.Written for commit 2f51d59. Summary will update on new commits.