Skip to content

Conversation

@Sayan-
Copy link
Contributor

@Sayan- Sayan- commented Nov 8, 2025

Overview

Following up on #84. Install and allow running against patchright instead of only playwright

Testing

Build + ran both headful + headless images. Confirmed execution working as expected with curl:

curl -sS http://localhost:444/playwright/execute \
  -H 'Content-Type: application/json' \
  -d '{"code":"await page.goto(\"https://example.com\"); return await page.title();"}'
{"result":"Example Domain","success":true}

Note

Adds Patchright support across images and runtime, selectable via PLAYWRIGHT_ENGINE, and tweaks headless Chromium flags.

  • Runtime
    • Update server/runtime/playwright-executor.ts to dynamically select chromium from patchright or playwright-core based on PLAYWRIGHT_ENGINE.
  • Images
    • Install patchright globally alongside playwright-core, typescript, and tsx in images/chromium-headful/Dockerfile and images/chromium-headless/image/Dockerfile.
  • Scripts
    • Pass through PLAYWRIGHT_ENGINE env in images/chromium-headful/run-docker.sh and images/chromium-headless/run-docker.sh.
  • Chromium Flags (Headless)
    • Adjust defaults in images/chromium-headless/image/wrapper.sh by removing several flags (e.g., --disable-component-update, --disable-default-apps, --disable-extensions, --enable-automation).

Written by Cursor Bugbot for commit 50d5bb3. This will update automatically on new commits. Configure here.

@Sayan- Sayan- requested review from hiroTamada and rgarcia November 8, 2025 00:27
@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Nov 8, 2025

Mesa Description

Overview

This PR replaces the playwright browser automation library with patchright, a patched version, for code execution. It builds on the work from PR #84 to fully integrate the new dependency.

Changes

  • Replaced the playwright NPM package with patchright in package.json.
  • Updated the playwright-executor.ts to import and use patchright.
  • Modified the Dockerfiles for both chromium-headful and chromium-headless images to install patchright and its dependencies.
  • The API endpoint remains /playwright/execute for backward compatibility.

Testing

Build + ran both headful + headless images. Confirmed execution working as expected with curl:

curl -sS http://localhost:444/playwright/execute \
  -H 'Content-Type: application/json' \
  -d '{"code":"await page.goto(\"https://example.com\"); return await page.title();"}'
{"result":"Example Domain","success":true}

Description generated by Mesa. Update settings

Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

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

Performed full review of 18771b2...50d5bb3

Analysis

  1. Static imports of both engines create a hard dependency on patchright being installed even when not in use, creating potential module loading failures if patchright installation fails but playwright-core succeeds. Consider implementing dynamic imports.

  2. Global removal of automation-related Chromium flags (--enable-automation, --disable-extensions, etc.) affects both playwright-core and patchright modes. These changes may impact existing automation scripts and should potentially be conditional based on the selected engine.

  3. Lack of validation for PLAYWRIGHT_ENGINE environment variable values could lead to silent failures with typos.

  4. Missing documentation for the PLAYWRIGHT_ENGINE variable and its valid values makes adoption and troubleshooting difficult.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

6 files reviewed | 0 comments | Edit Agent SettingsRead Docs

--disable-breakpad \
--disable-client-side-phishing-detection \
--disable-component-extensions-with-background-pages \
--disable-component-update \
Copy link
Contributor

Choose a reason for hiding this comment

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

I am little bit worry about deleting these flags because I dont what they are doing lol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Sayan- Sayan- merged commit 1d2d45e into main Nov 10, 2025
7 checks passed
@Sayan- Sayan- deleted the sayan/patchrightify branch November 10, 2025 17:17
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.

3 participants