Skip to content

fix: default playwright-cli to the chromium it ships - #13

Merged
ashwin153 merged 1 commit into
mainfrom
claude/devcontainer-feature-migration-u53qfp
Aug 5, 2026
Merged

fix: default playwright-cli to the chromium it ships#13
ashwin153 merged 1 commit into
mainfrom
claude/devcontainer-feature-migration-u53qfp

Conversation

@ashwin153

@ashwin153 ashwin153 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Softlight Overview

UX Score: 5/5

Softlight reviewed this change and found no issues.

To run Softlight again, click here or comment @softlight.

The feature installed a browser nothing could reach. Pulling the published devcontainer image and actually driving playwright-cli in it:

Chromium distribution 'chrome' is not found at /opt/google/chrome/chrome
Run "npx playwright install chrome"

playwright-cli defaults to the branded chrome channel, not the bundled Chromium that playwright install chromium downloads. So playwright-cli open failed while a perfectly good Chromium sat unused in /usr/local/share/ms-playwright.

Changes

  • src/playwright/devcontainer-feature.json — adds PLAYWRIGHT_MCP_BROWSER=chromium to containerEnv; bumps the feature to 1.1.0.
  • test/playwright/ubuntu.sh — asserts the env var, and opens/closes a browser with no --browser flag.
  • NOTES.md / README.md — explain why the variable is set.

How this was verified

Pulled ghcr.io/orianna-ai/devcontainer@sha256:d9aec848… and ran it as uid 1000 with HOME=/data/home on an empty volume, matching the sandbox pod:

result
playwright-cli open (no flag), before 'chrome' is not found
playwright-cli open --browser=chromium ✓ browser opened, screenshot written
playwright-cli open with PLAYWRIGHT_MCP_BROWSER=chromium ✓ navigated to a real page, 1280×720 PNG rendered

Why the existing tests missed it

Every check in the current scenario passed against the broken image — they verified the CLI was on PATH, the env var was set, and Chromium was on disk and readable. All true, and all insufficient: nothing ever launched a browser. The new check is the one that fails without this fix.

--browser still overrides per command, so callers that pass it explicitly (design_doctor's capture runner does) are unaffected.

Testing

pre-commit run --all-files passes. The scenario needs Docker, so it runs in CI.


Generated by Claude Code


Note

Low Risk
Container env default and documentation only; no auth, data, or API surface changes beyond making the existing CLI work out of the box.

Overview
Fixes playwright-cli open failing in the devcontainer when no --browser flag is passed: the CLI defaulted to the branded chrome channel at /opt/google/chrome/chrome even though the feature only installs Chromium under PLAYWRIGHT_BROWSERS_PATH.

The Playwright devcontainer feature now sets PLAYWRIGHT_MCP_BROWSER=chromium in containerEnv (feature version 1.1.0), with matching notes in NOTES.md / README.md. Per-command --browser overrides remain unchanged.

Tests assert the env var and add an end-to-end open/close without --browser, so CI catches “browser on disk but unreachable” regressions.

Reviewed by Cursor Bugbot for commit 341d398. Configure here.

Greptile Summary

The PR makes the Playwright feature default to its installed Chromium build rather than the unavailable branded Chrome channel.

  • Adds PLAYWRIGHT_MCP_BROWSER=chromium to the feature environment and bumps the feature version to 1.1.0.
  • Adds a functional no-flag browser launch check.
  • Documents the default and the per-command override behavior.

Confidence Score: 5/5

The PR appears safe to merge, with the changed default aligned to the browser installed by the feature and covered by a functional launch test.

The feature now selects its bundled Chromium for no-flag CLI launches, while explicit per-command browser selection remains documented as available, and no concrete regression was established.

Important Files Changed

Filename Overview
src/playwright/devcontainer-feature.json Sets the Playwright CLI browser default to the Chromium distribution installed by the feature and bumps the feature version.
test/playwright/ubuntu.sh Verifies the environment default and functionally opens and closes a browser without an explicit browser flag.
src/playwright/README.md Documents why Chromium is selected by default and how callers can override it.
src/playwright/NOTES.md Adds matching generated feature documentation for the browser default.

Reviews (1): Last reviewed commit: "fix: default playwright-cli to the chrom..." | Re-trigger Greptile

Pulling the published image and driving it showed the feature installed a browser nobody could
reach: playwright-cli opens the branded "chrome" channel by default and looks for it at
/opt/google/chrome/chrome, so "playwright-cli open" died with

  Chromium distribution 'chrome' is not found at /opt/google/chrome/chrome

while a working Chromium sat in /usr/local/share/ms-playwright. Setting PLAYWRIGHT_MCP_BROWSER in
containerEnv points the default at the bundled build; --browser still overrides per command.

The scenario now opens and closes a browser with no flag, which is the only check that would have
caught this — every existing check passed against the broken image.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MB7zNmdzPYMpwkUWxAjSFt
@ashwin153
ashwin153 merged commit eee7eb1 into main Aug 5, 2026
5 checks passed
@ashwin153
ashwin153 deleted the claude/devcontainer-feature-migration-u53qfp branch August 5, 2026 14:48
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