fix(mcp): skip ARIA snapshot serialization when snapshot-mode=none#41719
Open
yury-s wants to merge 2 commits into
Open
fix(mcp): skip ARIA snapshot serialization when snapshot-mode=none#41719yury-s wants to merge 2 commits into
yury-s wants to merge 2 commits into
Conversation
When snapshot mode is 'none', the ARIA snapshot produced by Tab.captureSnapshot() is never included in the response, yet it was still serialized on every tool call. On large pages this dominated response construction time (~166ms -> ~5ms in a repro). Pass an includeAria flag to captureSnapshot() so the expensive page.ariaSnapshot() call is skipped when not needed, while still collecting modal state, console links and events. Fixes: microsoft#41717
Contributor
Test results for "MCP"2 failed 7746 passed, 1248 skipped Merge workflow run. |
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.
Summary
snapshot-mode=none,Tab.captureSnapshot()still ran the expensivepage.ariaSnapshot()even though the snapshot is never emitted (~166ms → ~5ms on a large page in the reported repro).includeAriaflag tocaptureSnapshot()so the ARIA serialization is skipped when unused, while still collecting modal state, console links, and events.Fixes #41717