Repository navigation
Conversation
… non-verbose snapshots
Lightning00Blade
marked this pull request as ready for review
December 1, 2026 09:23
This was referenced Dec 1, 2026
timothybrush
pushed a commit
to timothybrush/chrome-devtools-mcp
that referenced
this pull request
Dec 1, 2026
…ols#3661) ## Summary Makes the `chrome-devtools` CLI exit with status `1` when an MCP tool call returns `isError: true` (such as element lookup errors, disabled tools, or validation errors), sliced out of draft ChromeDevTools#3656 as a standalone PR. - Previously, `chrome-devtools` only returned a non-zero exit code on transport/daemon failures (`!response.success`), so commands like `chrome-devtools fill` exited `0` on element errors and broke shell `&&` chains. - Preserves existing `md` and `json` stdout formatting when `isError: true`. - Adds unit tests in `tests/daemon/chrome-devtools-cli.test.ts` (for both `md` and `json` output formats) and updates disabled-tool expectations in `tests/e2e/chrome-devtools-disabled-tools.test.ts`. ## Verification - `npm run gen` and `npm run check-format` pass. - `NODE_TEST_REPORTER=spec node scripts/test.js tests/daemon/chrome-devtools-cli.test.ts tests/e2e/chrome-devtools-disabled-tools.test.ts`: 62 passed, 0 failed. - `NODE_TEST_REPORTER=spec node scripts/test.js tests/e2e/chrome-devtools*.test.ts`: 28 passed, 0 failed.
timothybrush
pushed a commit
to timothybrush/chrome-devtools-mcp
that referenced
this pull request
Dec 1, 2026
…ces (ChromeDevTools#3660) ## Summary Splits `skills/chrome-devtools-cli/SKILL.md` into a lean progressive-disclosure core skill plus on-demand reference files, sliced out of draft ChromeDevTools#3656 as a standalone PR. - **Core `SKILL.md`**: trimmed from 209 lines (12,689 bytes) to 52 lines (2,780 bytes, **-78% initial load**) while keeping the compact frontmatter unchanged and covering the everyday workflow (pages/navigation, snapshots, input automation, console/network/script debugging, screenshots, and daemon management). - **On-demand references** under `skills/chrome-devtools-cli/references/` (alongside existing `installation.md`): - `debugging-and-network.md`: network mocking, request/response body exports, CSS styles, logpoints, Lighthouse audits, screencasts, and additional input/navigation flags. - `performance-and-memory.md`: performance traces/insights, heap snapshots, and offline heap snapshot memory debugging commands. - `emulation-extensions-and-pwa.md`: emulation, viewport resizing, Chrome extensions, PWAs (`--categoryPwa=true`), and experimental tools (`click_at` via `--experimentalVision=true`, WebMCP, 3P developer tools). - Removed stale `--memoryDebugging=true`, `--categoryNetworkMocks=true`, `--categoryExperimentalWebmcp=true`, and `--categoryExperimentalThirdParty=true` startup requirements that are already enabled by default in CLI mode (`--viaCli`). ## Verification - `npm run gen`, `npm run check-format`, and `npm run verify-npm-package` pass. - Verified CLI defaults via `ServerConfig.applyDefaults({viaCli: true})`: only `--categoryPwa=true` and `--experimentalVision=true` are off by default in CLI mode. - Local Gemini CLI SxS on 4 tasks (1 core + 3 offloaded reference tasks) passed 4/4 on both arms, opening the matching reference file on demand on 3/3 offloaded tasks and 0/1 on the core task.
Contributor
Author
|
relevant stuff extracted already. closing |
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
This draft PR bundles four low-maintenance improvements that benefit both the CLI and MCP server workflows. Each change is isolated in its own commit so it can be reviewed independently or split into separate PRs if preferred.
1. Progressive-disclosure split for
skills/chrome-devtools-cli/SKILL.mdskills/chrome-devtools-cli/SKILL.mdfrom 209 lines (12,689 bytes) to 80 lines (4,248 bytes, ~67% smaller initial load) covering core setup, command conventions, key workflows, and a reference index.skills/chrome-devtools-cli/references/:debugging-and-network.mdperformance-and-memory.mdemulation-extensions-and-pwa.md2. Non-zero CLI exit codes on MCP tool errors
src/daemon/chrome-devtools-cli.tsto exit with code1when a tool call returnsisError: true(in addition to transport/daemon failures), while preserving existingmdandjsonstdout formatting.tests/daemon/chrome-devtools-cli.test.tsand updated disabled-tool CLI e2e expectations intests/e2e/chrome-devtools-disabled-tools.test.ts.3. Non-verbose
take_snapshotnoise reductionsrc/formatters/SnapshotFormatter.ts(orthogonal to element-scoped snapshots in feat: support element-scoped accessibility snapshots #3506):comboboxoption lists (> 10 options) in non-verbose text output while preserving selected options, DevTools-selected options, and an initial sample, with a... (<N> more options; use verbose=true to list all)hint.toJSON(),verbose: true,expanded: true, and short comboboxes (<= 10 options) are unchanged.LineBreakleaf nodes alongsideStaticTextwhen combined text matches the parent node name.take_snapshotmeasurements (includeIframes: true,interestingOnly: true):https://web.dev/: 460 lines / 28,987 chars -> 207 lines / 17,068 chars (-55% lines, -41% chars)https://www.wikipedia.org/: 127 lines / 7,375 chars -> 56 lines / 4,674 chars (-56% lines, -37% chars)4. Lazy typed
outputSchemadefinitions andstructuredContentparitysrc/tools/outputSchemas.tswith lazy() => ToolSchemafactories (zero Zod schema allocations at idle startup unless--experimentalStructuredContentis enabled) and attached them to 20 core structured tools.outputSchemaregistration insrc/index.tsgated by--experimentalStructuredContent.McpResponsestructuredContentwith the schemas (emitconsoleMessages: []andnetworkRequests: []when empty, surfacedialogHandled: truefrom wait-for results, and normalize WebMCPinputSchema/annotations).tests/tools/outputSchemas.test.tsand MCP stdio e2e coverage intests/index.test.ts.Verification
npm run genandnpm run check-formatpass.npm run test): 2,257 passed, 0 failed (2 platform-skipped).tests/e2e/lazy-startup.test.tsandtests/cli-imports.test.tspass.