Skip to content

fix(mcp): skip ARIA snapshot serialization when snapshot-mode=none#41719

Open
yury-s wants to merge 2 commits into
microsoft:mainfrom
yury-s:fix-41717
Open

fix(mcp): skip ARIA snapshot serialization when snapshot-mode=none#41719
yury-s wants to merge 2 commits into
microsoft:mainfrom
yury-s:fix-41717

Conversation

@yury-s

@yury-s yury-s commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

  • When snapshot-mode=none, Tab.captureSnapshot() still ran the expensive page.ariaSnapshot() even though the snapshot is never emitted (~166ms → ~5ms on a large page in the reported repro).
  • Pass an includeAria flag to captureSnapshot() so the ARIA serialization is skipped when unused, while still collecting modal state, console links, and events.

Fixes #41717

yury-s added 2 commits July 9, 2026 13:39
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
@yury-s yury-s requested a review from pavelfeldman July 9, 2026 21:50
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [chrome] › mcp/cli-killall.spec.ts:42 › kill-all kills filtered dashboard pid @mcp-macos-latest-chrome
❌ [chrome] › mcp/annotate.spec.ts:57 › should capture multiple screenshots in one annotation @mcp-ubuntu-latest-chrome

7746 passed, 1248 skipped


Merge workflow run.

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.

[MCP] snapshot-mode=none still serializes the ARIA snapshot

1 participant