Conversation
OrKoN
left a comment
There was a problem hiding this comment.
let's fix the serilization issue without adding the env variable support. Could the --config option documented here https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/configuration.md be used instead (it will be included in the next release #2691)
e76de1a to
0c3a049
Compare
|
Updated per your suggestion — I rebased onto current
I also narrowed the security claim to just avoiding an unnecessary copy of config-held credentials into the daemon process argv. No claim that the config file itself is a secret store.
|
OrKoN
left a comment
There was a problem hiding this comment.
Let's make these changes:
- Serialize object values (such as
wsHeaders) directly insideserializeArgsinsrc/daemon/utils.ts(typeof value === 'object' ? JSON.stringify(value) : String(value)) and removeserializeArgsForDaemonandhasExplicitWsHeaders. Becausesrc/bin/chrome-devtools.tsdoes not register Yargs.config(),argv.wsHeadersis never populated from--configin the CLI process, makinghasExplicitWsHeadersdead code while leavingserializeArgsbroken ([object Object]) for direct callers. - Guard the
argv.isolated = trueandargv.headless = truedefaults insrc/bin/chrome-devtools.ts(lines 142–158) with!argv.config. Whenchrome-devtools start --config=...is used without CLI browser flags, injecting--isolatedand--headlessinto the daemon argv overrides config values (isolated: false,headless: false) and causes a fatal Yargs conflict (Arguments isolated and userDataDir/autoConnect are mutually exclusive) when the daemon loads the config file.
|
Updated per the second review: object serialization now lives directly in |
Signed-off-by: Robert McConnell <robert@mcc0nnell.org>
038173d to
aab2020
Compare
Summary
Fix daemon argument serialization for object-valued CLI options.
serializeArgs()currently falls back toString(value)for non-boolean, non-array values. Yargs parses options such aswsHeadersinto an object, so direct serialization produces[object Object]and the daemon cannot reconstruct the value.This change serializes object values with
JSON.stringify()while preserving the existing behavior for primitive, boolean, and array options.Review follow-up
The earlier review also identified CLI-injected
isolated/headlessdefaults interacting badly with--config. Current upstreammainhas since removed those assignments entirely, so after rebasing there is no additional default-guard change to carry in this PR.Validation
serializeArgsregression for object valuesgit diff --check