Fix Playwright MCP initialization failure on GitHub Actions runners#16262
Fix Playwright MCP initialization failure on GitHub Actions runners#16262
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot review changes and compare with playwright docs. validate new flags. |
|
🧪 Smoke Temporary ID is now testing temporary ID functionality... |
|
🧪 Smoke Project is now testing project operations... |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
❌ Smoke Copilot SDK failed. Please review the logs for details. |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
I've validated the Docker flags against official Playwright documentation and the Playwright MCP container source. Here's the verification: ✅ ✅ ✅
Alternative consideration: We could use Playwright's official seccomp profile instead of Commit: 875dbb7 |
|
✅ Smoke Temporary ID completed successfully. Temporary ID validation passed. |
Agent Container Tool Check ✅
Result: 12/12 tools available ✅ PASS All required development tools are present and functional in the agent container environment.
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical issue where the Playwright MCP server fails to initialize on GitHub Actions runners with an "EOF" error. The root cause is that Chromium crashes during startup due to missing Docker security flags required for browser automation in containerized CI environments.
Changes:
- Added
--security-opt seccomp=unconfinedand--ipc=hostDocker flags to Playwright container configuration for Chromium sandbox compatibility - Added comprehensive troubleshooting documentation for the EOF initialization error
- Updated GitHub Actions compatibility note in Playwright tool reference
- Recompiled 9 Playwright-enabled workflows with the updated container arguments
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/mcp_config_playwright_renderer.go | Added security-opt and ipc-host Docker flags to the JSON format renderer for Playwright MCP configuration |
| docs/src/content/docs/troubleshooting/common-issues.md | Added troubleshooting entry explaining the EOF error, its cause, solution, and upgrade instructions |
| docs/src/content/docs/reference/tools.md | Added GitHub Actions compatibility note mentioning the required security flags |
| .github/workflows/unbloat-docs.lock.yml | Recompiled with updated Playwright container args including security flags |
| .github/workflows/smoke-copilot.lock.yml | Recompiled with updated Playwright container args including security flags |
| .github/workflows/smoke-codex.lock.yml | Recompiled with updated Playwright container args (JSON format only; TOML format missing flags) |
| .github/workflows/smoke-claude.lock.yml | Recompiled with updated Playwright container args including security flags |
| .github/workflows/slide-deck-maintainer.lock.yml | Recompiled with updated Playwright container args including security flags |
| .github/workflows/docs-noob-tester.lock.yml | Recompiled with updated Playwright container args including security flags |
| .github/workflows/daily-multi-device-docs-tester.lock.yml | Recompiled with updated Playwright container args including security flags |
| .github/workflows/cloclo.lock.yml | Recompiled with updated Playwright container args including security flags |
| .github/workflows/blog-auditor.lock.yml | Recompiled with updated Playwright container args including security flags |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Add security-opt and ipc flags for Chromium browser compatibility in GitHub Actions | ||
| // --security-opt seccomp=unconfined: Required for Chromium sandbox to function properly | ||
| // --ipc=host: Provides shared memory access required by Chromium | ||
| dockerArgs := []string{"--init", "--network", "host", "--security-opt", "seccomp=unconfined", "--ipc=host"} |
There was a problem hiding this comment.
The TOML renderer for Playwright MCP configuration is missing the security flags that were added to the JSON renderer. The renderPlaywrightTOML function in mcp_renderer.go (lines 228-233) still only includes --init, --network, and host in the args array, but it should also include --security-opt, seccomp=unconfined, and --ipc=host.
This is critical because Codex engine uses the TOML format for MCP configuration. The smoke-codex.lock.yml workflow shows that the TOML config (lines 952-967) is missing these flags while the JSON config (lines 1011-1029) has them. This means Playwright will still fail with "EOF" errors in Codex workflows even after this fix.
The security flags need to be added to the TOML renderer in the same way they were added to the JSON renderer to ensure consistent behavior across all engine types.
There was a problem hiding this comment.
Fixed. Added the same Docker security flags (--security-opt seccomp=unconfined and --ipc=host) to the TOML renderer in mcp_renderer.go for Codex engine. The smoke-codex.lock.yml workflow now includes these flags in the TOML configuration, ensuring consistent Playwright behavior across all engine types.
Commit: 6a9020b
|
✅ Smoke Project completed successfully. All project operations validated. |
|
Smoke test results
|
Smoke Test Results
Status: PASS (10/11) cc:
|
There was a problem hiding this comment.
✅ Changes look good - fixes Playwright initialization on GitHub Actions by adding required Docker security flags.
📰 BREAKING: Report filed by Smoke Copilot for issue #16262
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude for issue #16262
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
Playwright MCP server fails during initialization with "initialize: EOF" on GitHub Actions. Chromium crashes before MCP completes tool registration due to missing container security flags.
Changes
Container configuration
pkg/workflow/mcp_config_playwright_renderer.go: Added Docker security flags to JSON renderer (Copilot/Claude engines)pkg/workflow/mcp_renderer.go: Added Docker security flags to TOML renderer (Codex engine)Key changes:
--security-opt seccomp=unconfinedfor Chromium sandbox compatibility--ipc=hostfor shared memory accessDocumentation
Workflows
Technical context
GitHub Actions runners use seccomp filtering and restricted IPC namespaces. Chromium's sandbox requires relaxed seccomp and
/dev/shmaccess, standard for containerized browser automation in CI.The fix ensures consistent Playwright behavior across all engine types (Copilot, Claude, Codex) by applying the same Docker security flags to both JSON and TOML MCP configuration renderers.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
✨ PR Review Safe Output Test - Run 22081981970
✨ PR Review Safe Output Test - Run 22082130754