Skip to content

Conversation

@pavelfeldman
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Implements image size capping for MCP browser screenshot functionality to comply with Claude's vision API requirements. The changes cap images at 1.15 megapixels and maximum linear dimension of 1568 pixels.

  • Introduces image scaling functionality to reduce large screenshots before sending to LLM
  • Refactors image utilities to make them reusable across the codebase
  • Adds comprehensive test coverage for the new image size capping behavior

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/mcp/screenshot.spec.ts Adds test cases for image size capping with various dimensions
packages/playwright/src/mcp/browser/tools/screenshot.ts Implements image scaling logic and removes conditional image return
packages/playwright-core/src/utils.ts Exports new imageUtils module
packages/playwright-core/src/server/utils/imageUtils.ts New utility module with image scaling and padding functions
packages/playwright-core/src/server/utils/comparators.ts Refactors to use shared image utilities

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pavel Feldman <pavel.feldman@gmail.com>
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Test results for "MCP"

2557 passed, 108 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › runner.spec.ts:118 › should ignore subprocess creation error because of SIGINT @macos-latest-node18-1

2 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104 › should work with strict CSP policy `@firefox-ubuntu-22.04-node18`

47032 passed, 816 skipped


Merge workflow run.

@pavelfeldman pavelfeldman merged commit 1532d51 into microsoft:main Oct 15, 2025
34 of 35 checks passed
renovate bot added a commit to izumin5210/dotfiles that referenced this pull request Oct 20, 2025
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [@playwright/mcp](https://playwright.dev)
([source](https://redirect.github.com/microsoft/playwright-mcp)) |
[`0.0.42` ->
`0.0.43`](https://renovatebot.com/diffs/npm/@playwright%2fmcp/0.0.42/0.0.43)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@playwright%2fmcp/0.0.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@playwright%2fmcp/0.0.42/0.0.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>microsoft/playwright-mcp (@&#8203;playwright/mcp)</summary>

###
[`v0.0.43`](https://redirect.github.com/microsoft/playwright-mcp/releases/tag/v0.0.43)

[Compare
Source](https://redirect.github.com/microsoft/playwright-mcp/compare/v0.0.42...v0.0.43)

##### MCP Changes Since Last Release

- **Incremental page snapshots**: `pageState` now supports diffs.
Unchanged subtrees are collapsed as `- ref=<id> [unchanged]`. Reduces
noise and payload size.
[microsoft/playwright#37795](https://redirect.github.com/microsoft/playwright/issues/37795)
- **Encourage relative path usage** — MCP now suggests using relative
paths for portability
[microsoft/playwright#37857](https://redirect.github.com/microsoft/playwright/issues/37857)
- **Image size cap** — Added limits on rendered image sizes to prevent
resource overuse
[microsoft/playwright#37856](https://redirect.github.com/microsoft/playwright/issues/37856)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/izumin5210/dotfiles).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE0My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

2 participants