perf(mcp): skip aria snapshot capture when the response discards it - #41923
Merged
Pavel Feldman (pavelfeldman) merged 2 commits intoJul 31, 2026
Merged
Conversation
| // tree walk, which dominates response latency on heavy pages. Console, | ||
| // events and modal states are still reported. | ||
| if (!includeAria) { | ||
| if (this.modalStates().length) |
There was a problem hiding this comment.
Duplication isn't nice here, easy to forget things in one of the modes.
Contributor
Author
There was a problem hiding this comment.
good call. collapsed the two paths so only the aria walk is conditional; the console/events tail and modal fallback now live in one place.
| }; | ||
| }); | ||
| } else if (this.modalStates().length) { | ||
| // Matches the aria path's modal fallback below, without the race: there |
There was a problem hiding this comment.
We don't welcome low snr comments, coding agents are stubborn at not listening to our claude.md though.
Pavel Feldman (pavelfeldman)
approved these changes
Jul 27, 2026
Contributor
Test results for "MCP"7792 passed, 1269 skipped Merge workflow run. |
Pavel Feldman (pavelfeldman)
merged commit Jul 31, 2026
15b1aec
into
microsoft:main
18 checks passed
This was referenced Aug 5, 2026
Yury Semikhatsky (yury-s)
added a commit
to microsoft/playwright-mcp
that referenced
this pull request
Aug 6, 2026
## What's New ### Tool Improvements - **`browser_take_screenshot` — WebP format** — New `type` option to pick the image format (`png`, `jpeg` or `webp`); when unset, the format is inferred from the filename extension ([#41152](microsoft/playwright#41152)) - **`--codegen` — more languages** — Code generation now supports `python`, `java` and `csharp` in addition to `typescript` ([#42106](microsoft/playwright#42106)) - **Configurable settle delay** — New `--timeout-settle` flag (and `timeouts.settle` config option) to control how long to wait after each action for triggered work (navigations, requests) to settle, defaults to 500ms ([#41924](microsoft/playwright#41924)) ## Fixes - Aria snapshot capture is skipped when the response discards it ([#41923](microsoft/playwright#41923)) - New `--snapshot-boxes` flag (and `snapshot.boxes` config option) to enable bounding boxes in snapshots globally — previously this was only available per command ([#42102](microsoft/playwright#42102)) - Reconnect to the browser after a disconnect ([#41966](microsoft/playwright#41966)) - Report malformed JSON config instead of silently falling back to INI parsing ([#41909](microsoft/playwright#41909)) - Clear the dialog modal state when a dialog is closed out of band ([#42032](microsoft/playwright#42032)) - Detect downloads via the download event instead of guessing from `net::ERR_ABORTED` navigation errors ([#41933](microsoft/playwright#41933)) - Surface the missing executable path when a browser isn't installed ([#41941](microsoft/playwright#41941)) - Escape user input in codegen output ([#41962](microsoft/playwright#41962)) - Removed the stale `--output-mode` CLI option ([#41833](microsoft/playwright#41833)) ### Browser Extension - Validate `Host` and `Origin` headers on CDP relay WebSocket upgrades ([#42103](microsoft/playwright#42103)) - Launch the Chrome profile that has the extension installed ([#41939](microsoft/playwright#41939)) - Pass `noDefaults` for extension CDP connections ([#42119](microsoft/playwright#42119)) - Mention `PLAYWRIGHT_MCP_EXECUTABLE_PATH` in the error shown when the browser executable is not found ([#42122](microsoft/playwright#42122)) - Removed support for extension protocol v1 ([#41857](microsoft/playwright#41857))
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
Response.serializecaptured a full aria snapshot on every tool response, then discarded it when the response does not render one (snapshot modenone, or tools likebrowser_run_code_unsafethat never request a snapshot).