Skip to content

fix: update playwright prompt and workflows to use host.docker.internal#29825

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/update-playwright-docker-access
Closed

fix: update playwright prompt and workflows to use host.docker.internal#29825
Copilot wants to merge 2 commits intomainfrom
copilot/update-playwright-docker-access

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 2, 2026

Summary

Updates the playwright prompt and all related workflow files to instruct agents to use host.docker.internal instead of localhost (or the previous dynamic bridge IP approach) when navigating to local web services with Playwright browser tools.

Problem

The Playwright MCP server runs inside a Docker container. When agents start a local documentation server (e.g. npm run dev) and then try to navigate to it with Playwright using localhost or the agent container's bridge IP (e.g. 172.30.0.20:4321), the connection times out because:

  • Playwright's localhost is the Docker host's localhost, not the agent container's
  • The bridge IP approach is unreliable due to network isolation constraints in some AWF configurations

Reference run: https://github.com/github/gh-aw/actions/runs/25259515081/job/74064550688

Solution

Use host.docker.internal as the hostname for Playwright navigation URLs, which is Docker's standard mechanism for cross-container host access.

Changes

  • actions/setup/md/playwright_prompt.md: Added actionable instruction text explaining that Playwright is containerized and agents should use host.docker.internal instead of localhost for browser navigation
  • .github/workflows/shared/docs-server-lifecycle.md: Replaced the bridge IP detection approach with host.docker.internal, removed the bridge IP lookup bash snippet, simplified the "Playwright Browser Access" section
  • .github/workflows/unbloat-docs.md: Updated playwright URL example
  • .github/workflows/visual-regression-checker.md: Updated agent prompt URL
  • .github/workflows/daily-multi-device-docs-tester.md: Replaced bridge IP lookup + variable substitution with host.docker.internal
  • .github/workflows/docs-noob-tester.md: Replaced bridge IP detection step and file-based URL approach with host.docker.internal
  • pkg/cli/workflows/test-copilot-playwright-screenshots.md: Updated playwright navigation URL
  • pkg/cli/workflows/test-claude-playwright-screenshots.md: Updated playwright navigation URL
  • Golden test files: Updated to reflect recompiled workflow content

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