chore: in-page tool output: stash DOM elements and preprocess for serialization#1877
Merged
chore: in-page tool output: stash DOM elements and preprocess for serialization#1877
Conversation
OrKoN
reviewed
Apr 16, 2026
OrKoN
reviewed
Apr 16, 2026
OrKoN
reviewed
Apr 16, 2026
OrKoN
reviewed
Apr 16, 2026
83b53db to
7119995
Compare
7119995 to
5ee5e30
Compare
OrKoN
reviewed
Apr 22, 2026
OrKoN
reviewed
Apr 22, 2026
OrKoN
approved these changes
Apr 22, 2026
extract creating extra snapshot nodes into separate function format address comments move to McpPage
4535086 to
e963f17
Compare
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.
Improvements for handling in-page tool responses. In order to successfully pass an in-page tool response from the page context to the MCP server, the response needs to be serializable. The code walks the response object an performs the following changes:
If the in-page tool response contains DOM elements which are not part of the page snapshot, a new snapshot is created add the missing elements are added explicitly.