Repository navigation
fix(mcp): say how to install Chromium when it is missing - #287
Merged
Merged
Conversation
…it again once it is npx installs the CLI and its peer playwright, not the browser, which Playwright downloads apart. Without it, run_snippet answered with the first line of the error of Playwright, the path of a missing executable, and lost its advice, which installs every browser. The tools that open Chromium (run_snippet, run_workflow, open_page) and the CLI say instead how to install the one browser the CLI uses: an error of the tool the model can act on, by running the command and calling again. The sessions of the server kept the promise of the launch, also when it failed, so open_page kept failing after the install until the client restarted the server. A server with state keeps what it has, not a failure: the next page launches again.
…talls them npm run smoke:cli-package packs cli/ with the snippets as the publish workflow does, installs the tarball in an empty folder and talks to webperf-snippets mcp over stdio: list_snippets answers without Chromium, run_snippet says how to install it, and after npx playwright install chromium it measures a local page. The install brings the latest playwright the peer range allows (1.64.1 today, while the repository tests with 1.63), so a user needs the Chromium of that version even with another one on the machine. It needs the network and runs by hand before a release of the CLI.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 of 5 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chapter 7a of the MCP server, before its publication: the CLI as a user installs it, with
npx -y webperf-snippets mcp. npx installs the package and its peerplaywright, not Chromium, so the first call of an agent failed with the error of Playwright.run_snippet,run_workflow,open_pageand the CLI answerChromium for Playwright is not installed. Install it once with: npx playwright install chromium(cli/src/browser.js). The CLI prints it without a stack and exits with 1.open_pageworks without restarting the client.npm run smoke:cli-packagepacks the CLI as the publish workflow does, installs it in an empty folder and checks the MCP server over stdio without Chromium and after installing it. It needs the network, so it runs by hand before a release (docs/RELEASING.md).Test plan
cli/tests/e2e/missing-browser.test.js: the three tools over stdio and the CLI with an emptyPLAYWRIGHT_BROWSERS_PATH, andopen_pageafter a failed launch; the 5 cases failed before the change, locallynpm run smoke:cli-package, locally: npm installed playwright 1.64.1; without Chromium,list_snippetslists 56 snippets andrun_snippetgives the install command; afternpx playwright install chromium,run_snippetmeasures LCP (40 ms, ok)