feat: replace Playwright MCP container with pre-installed @playwright/cli in agent image#2466
feat: replace Playwright MCP container with pre-installed @playwright/cli in agent image#2466
Conversation
Pre-install @playwright/cli and Chromium headless shell in the AWF agent container, replacing the separate Playwright MCP Docker container approach. Update smoke-claude and smoke-codex to use playwright-cli bash commands. Add docs for the new approach. Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/0b42f528-4a25-44a3-9b05-90864c36ffd2
Reduce agent container image size by cleaning npm cache and temporary playwright installation files after installation. Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/0b42f528-4a25-44a3-9b05-90864c36ffd2
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR migrates Playwright smoke testing from a separate Playwright MCP Docker container to a CLI-first approach by pre-installing @playwright/cli in the agent image, reducing networking complexity and MCP tool/schema overhead.
Changes:
- Pre-install
@playwright/cliand Chromium headless shell in the agent container. - Update smoke workflow markdown (and compiled lock workflows) to remove the Playwright MCP server/tooling and instead use
playwright-cliviabash. - Extend Playwright testing documentation to describe the CLI approach and compare it to the MCP container.
Show a summary per file
| File | Description |
|---|---|
containers/agent/Dockerfile |
Installs @playwright/cli + Chromium shell during image build. |
docs-site/src/content/docs/guides/playwright-testing.md |
Adds CLI vs MCP guidance and example playwright-cli usage. |
.github/workflows/smoke-claude.md |
Removes Playwright tool/network allowlist and switches to playwright-cli instructions. |
.github/workflows/smoke-codex.md |
Removes Playwright tool/network allowlist and switches to playwright-cli instructions. |
.github/workflows/smoke-claude.lock.yml |
Compiled workflow updates removing Playwright MCP config/tooling. |
.github/workflows/smoke-codex.lock.yml |
Compiled workflow updates removing Playwright MCP config/tooling and image manifest entry. |
.github/workflows/test-coverage-reporter.lock.yml |
Compiled workflow updates (notably local AWF build/install + session-state collection changes). |
.github/workflows/refactoring-scanner.lock.yml |
Compiled workflow updates (local AWF build/install + session-state collection changes). |
.github/workflows/export-audit.lock.yml |
Compiled workflow updates (local AWF build/install + session-state collection changes). |
.github/workflows/duplicate-code-detector.lock.yml |
Compiled workflow updates (local AWF build/install + session-state collection changes). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
containers/agent/Dockerfile:186
- Installing
@playwright/cliwithout a version pin makes the agent image build non-reproducible and can introduce breakages from upstream changes (including transitive deps and postinstall behavior). Consider pinning to a known-good version (and bump it intentionally) to keep image builds deterministic.
RUN npm install -g @playwright/cli && \
docs-site/src/content/docs/guides/playwright-testing.md:41
- The example
playwright-cli open https://myapp.localhost:3000will resolve to loopback inside the container (per*.localhostsemantics), not to the host machine’s dev server. For host-served apps, the docs should point tohttp://host.docker.internal:3000(and ensure the workflow allowslocalhost/host ports), or otherwise clarify the networking expectations.
# Interact with the page
playwright-cli open https://myapp.localhost:3000
playwright-cli click "Get Started"
- Files reviewed: 10/10 changed files
- Comments generated: 2
| RUN npm install -g @playwright/cli && \ | ||
| playwright-cli install-browser chromium --with-deps --only-shell && \ |
| The AWF agent container pre-installs [`@playwright/cli`](https://github.com/microsoft/playwright-cli), a CLI-based interface designed for coding agents. It runs directly inside the agent container with native `localhost` access — no extra Docker container, no networking hacks. | ||
|
|
Smoke Test Results✅ GitHub MCP: Last 2 merged PRs (#2465, #2439) Overall: PASS
|
Chroot Version Comparison Results
Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot.
|
🏗️ Build Test Suite Results
Overall: 0/8 ecosystems passed — ❌ FAIL ❌ Error DetailsALL_CLONES_FAILED: All repository clones failed because the No tests could be executed. Please ensure
|
Smoke Test: Services Connectivity
Overall: FAIL —
|
🔍 Smoke Test Results
Overall: FAIL — workflow template variables ( PR: feat: replace Playwright MCP container with pre-installed
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🔥 Smoke Test: Copilot BYOK (run 25601421718)
Running in BYOK offline mode ( Overall: PASS (1 test skipped due to unresolved workflow template variable) PR by
|
This comment has been minimized.
This comment has been minimized.
Smoke Test Codex
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
The Playwright MCP approach runs a separate Docker container, requiring
host.docker.internalrouting hacks, extra image pull overhead, and large MCP tool schemas that consume model context.@playwright/clieliminates all of this by running directly inside the agent container.Agent container
@playwright/cliglobally via npm--only-shell) with system deps viaplaywright-cli install-browser chromium --with-deps --only-shellSmoke workflows (
smoke-claude.md,smoke-codex.md)tools: playwright:andnetwork: allowed: playwright— no MCP container neededplaywright-clibash commands:mcr.microsoft.com/playwright/mcpremoved from manifestsDocumentation
Updated
docs-site/playwright-testing.mdwith a new Agentic Workflows: Use@playwright/clisection documenting the CLI approach and a comparison table vs. the MCP container.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/actions/github-script/git/ref/tags/v9/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv(http block)If you need me to access, download, or install something from one of these locations, you can either: