fix(cli): apply headless default on implicit daemon auto-start#2236
Open
inwaar wants to merge 1 commit into
Open
fix(cli): apply headless default on implicit daemon auto-start#2236inwaar wants to merge 1 commit into
inwaar wants to merge 1 commit into
Conversation
The `chrome-devtools start` command handler defaults headless to true when not explicitly provided, but the implicit auto-start path (triggered transparently when running a tool command like `new_page` with no running daemon) bypassed this logic entirely, inheriting the MCP server's built-in default of headless=false. This caused failures in environments without an X server (e.g., devcontainers, CI). Extract a shared getDefaultedStartArgs() helper that applies the same defaults (`headless: true`, `isolated: true`) for both the explicit `start` command and the implicit auto-start path.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Lightning00Blade
left a comment
Collaborator
There was a problem hiding this comment.
Looks good, can we add a test and fix the error from CI about the docs (npm run gen should fix them).
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.
The
chrome-devtools startcommand handler defaultsheadless: truewhen not explicitly provided, but the implicit auto-start path (triggered transparently when running a tool command likenew_pagewith no running daemon) bypassed this logic entirely. This meant the daemon would launch in headful mode by default when auto-started from a tool command, causing failures in environments without an X server (e.g., devcontainers, CI).This PR extracts a shared
getDefaultedStartArgs()helper that applies the same defaults (headless: true,isolated: true) for both the explicitstartcommand and the implicit auto-start path.Related: the
startcommand handler also had a// Defaults but we do not want to affect the yargs conflict resolution.comment explaining why defaults are applied after yargs parsing rather than via the option definitions — this behavior is preserved in the extracted helper.