Skip to content

Commit 7b85046

Browse files
committed
fix: keep playwright mcp preflight local
1 parent 9b326e8 commit 7b85046

3 files changed

Lines changed: 33 additions & 3 deletions

File tree

docs/case-studies/issue-1901/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,27 @@ The test also feeds an interactive `system.init` event with:
216216
The expected comment now states that Playwright MCP tools are unavailable and
217217
warns that no `mcp__playwright__*` tools were exposed.
218218

219+
## Follow-up Review Notes
220+
221+
The PR #1907 follow-up review asked whether `--skip-tool-connection-check` and
222+
the deployment gist's `--no-tool-check` overrides should affect Playwright MCP.
223+
They should not. Those flags only skip paid AI-tool connection probes; the
224+
`solve` Playwright MCP preflight is local/free and still runs when Playwright
225+
support is enabled. Dry-run mode remains the only broad solve path that skips
226+
that preflight.
227+
228+
Telegram `/version` uses the same `formatVersionMessage()` path as CLI version
229+
reporting, so pending or otherwise unavailable Playwright MCP rows render as
230+
`not connected` there as well.
231+
232+
The checked deployment gist already re-applies Claude and Codex Playwright MCP
233+
registration after host-mounted `/home/box/.claude*` and `/home/box/.codex`
234+
configuration can shadow image-baked defaults. No required gist change is
235+
needed to remove `--no-tool-check` after this fix. A useful future hardening is
236+
to align the gist's status parsing with Hive Mind's shared unavailable-row
237+
patterns and keep explicit `playwright --version` plus
238+
`npx --no-install @playwright/mcp --help` probes.
239+
219240
## Limitations
220241

221242
This Hive Mind fix does not force a running Claude Code process to reconnect a

src/solve.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,14 @@ await cascadePlaywrightMcpDisable(argv, log);
249249
if (!(await performSystemChecks(argv.minDiskSpace || 2048, skipToolConnectionCheck, argv.model, argv))) {
250250
await safeExit(1, 'System checks failed');
251251
}
252-
if (!skipToolConnectionCheck) {
252+
// Playwright MCP preflight is local/free and stays independent from paid tool connection checks.
253+
if (!argv.dryRun && argv.playwrightMcp !== false) {
253254
const playwrightMcpPreflight = await ensureSolvePlaywrightMcpReady({ argv, log });
254255
if (!playwrightMcpPreflight.ok) {
255256
await safeExit(1, 'Playwright MCP preflight failed');
256257
}
257-
} else if (argv.playwrightMcp !== false) {
258-
await log('⏩ Skipping Playwright MCP preflight (dry-run mode or skip-tool-connection-check enabled)', { verbose: true });
258+
} else if (argv.dryRun && argv.playwrightMcp !== false) {
259+
await log('⏩ Skipping Playwright MCP preflight (dry-run mode)', { verbose: true });
259260
}
260261
// URL validation debug logging
261262
if (argv.verbose) {

tests/test-issue-1901-playwright-mcp-pending.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ await asyncTest('Issue #1901: solve runs Playwright MCP preflight before startin
189189
assert.ok(solveSource.includes("await safeExit(1, 'Playwright MCP preflight failed')"), 'solve.mjs should fail immediately when Playwright MCP preflight fails');
190190
});
191191

192+
await asyncTest('Issue #1901: skip-tool-connection-check does not skip local Playwright MCP preflight', async () => {
193+
const solveSource = await read('src/solve.mjs');
194+
195+
assert.doesNotMatch(solveSource, /if\s*\(!skipToolConnectionCheck\)\s*{\s*const playwrightMcpPreflight = await ensureSolvePlaywrightMcpReady/s);
196+
assert.match(solveSource, /if\s*\(!argv\.dryRun && argv\.playwrightMcp !== false\)\s*{\s*const playwrightMcpPreflight = await ensureSolvePlaywrightMcpReady/s);
197+
assert.ok(!solveSource.includes('skip-tool-connection-check enabled'), 'Playwright MCP preflight skip message should not mention skip-tool-connection-check');
198+
});
199+
192200
await asyncTest('Issue #1901: Docker image verification rejects unavailable Playwright MCP rows', async () => {
193201
const verifyScript = await read('scripts/verify-docker-image.sh');
194202
assert.match(verifyScript, /PLAYWRIGHT_MCP_UNAVAILABLE_RE=/);

0 commit comments

Comments
 (0)