Repository navigation
chore(config): support reloadable configurations - #3048
Conversation
5363a8d to
10c59be
Compare
OrKoN
left a comment
There was a problem hiding this comment.
Please address the following:
-
Move
experimentalDevtoolsintoRESTART_REQUIRED_OPTIONS(src/config/mcp-options.ts) and drop it from the "applies reloadable options" test intests/config/mcp-options.test.ts.BrowserManagerdestructures it asdevtoolswhen launching Chrome, so changing it after startup silently has no effect on the running browser. -
Replace the deny-list with an explicit per-option
reloadableflag (or an allow-list of reloadable options) so that every new option is restart-required unless someone opts it in. With the current design a misclassification like item 1 fails open, and nothing forces the author of a new option to think about reload semantics. -
Make
ConfigParser.mergeReloadableOptions(src/config/ConfigParser.ts) merge and validate explicit inputs beforeapplyDefaults, rather than runningvalidateConflicts/validateImplicationson fully defaultedParsedArguments. The step-4 contract says "Only explicit inputs are checked, so defaults never conflict"; validating resolved args breaks that, and the newfilesystemRootskip inapplyDefaultsis a workaround for exactly this that also changes non-reload startup output. -
Stub the locator in the
parseArgshelper of themergeReloadableOptionstests (tests/config/mcp-options.test.ts) and passexitProcess = false. Withenv = {}the realConfigLocatorfalls back to~/.config/cd4a/config.json, so the tests depend on the developer's machine and a parse error would callprocess.exitinside the test runner. -
Split the
options.defaultDescription = JSON.stringify(opt.default)change insrc/bin/chrome-devtools.tsinto its own PR or explain it in the commit message. It is unrelated to reload classification and changes CLI behaviour: yargs no longer applies command-arg defaults, and theargName in argvforwarding loop then omits those args, so the daemon-side command handler must now apply defaults itself. -
Update the PR title and add a description.
ConfigParser.reload()already exists onmain; this PR addsmergeReloadableOptionsandRESTART_REQUIRED_OPTIONS, and the body is currently empty.
Nit (non-blocking): (merged as Record<string, unknown>)[name] = previous[name] uses an as cast, which AGENTS.md forbids; Object.assign(merged, Object.fromEntries(RESTART_REQUIRED_OPTIONS.map(n => [n, previous[n]]))) avoids it. Also restore the removed constructor JSDoc for the new configLocator parameter.
10c59be to
9b13959
Compare
|
This does not implement reload() as the title says? |
## Summary Add a **Pre-submit checklist** section to `AGENTS.md`. Each item comes from a recent review finding or a landed bug fix in this repository. The checklist has five groups: - **Scope and PR description**: one change per PR, title and commit type match, description lists every behavior change and matches the diff, `npm run gen` and `npm run format` ran. - **Design**: fix in the lowest layer that owns the data, fix upstream (Puppeteer, devtools-frontend) first, one helper for repeated code, options objects instead of positional `undefined` arguments, validation in Zod schemas. - **Correctness and edge cases**: no stale state after a failed call, artifacts written before a throw, abandoned async continuations, mutex guards, file removal races, `dispose()` releases every resource, secrets never reach logs, path parameters validated even when they parse as URLs. - **Tests**: every new function has a test, no vacuous assertions, `notCalled` targets the first call after validation, exact-argument assertions, reusable stubs in `tests/mocks.ts`, bounded timeouts, no second CDP session for event waits. - **Documentation and output**: tool descriptions state when a parameter is ignored, skills stay generic, one-sentence inline comments. Sources: review comments on ChromeDevTools#2679, ChromeDevTools#2797, ChromeDevTools#2859, ChromeDevTools#2881, ChromeDevTools#2901, ChromeDevTools#3048, ChromeDevTools#3082, ChromeDevTools#3109, ChromeDevTools#3120, ChromeDevTools#3132, ChromeDevTools#3134, ChromeDevTools#3139, ChromeDevTools#3148, ChromeDevTools#3156, ChromeDevTools#3158, ChromeDevTools#3161, ChromeDevTools#3182, ChromeDevTools#3183, ChromeDevTools#3186, ChromeDevTools#3187, ChromeDevTools#3188, ChromeDevTools#3189, ChromeDevTools#3192, ChromeDevTools#3196, ChromeDevTools#3197, ChromeDevTools#3198, ChromeDevTools#3203, ChromeDevTools#3204, and fixes ChromeDevTools#3150, ChromeDevTools#3160, ChromeDevTools#3185, ChromeDevTools#3202, ChromeDevTools#3207, ChromeDevTools#3208. Existing content in `AGENTS.md` is unchanged. Closes ChromeDevTools#3222
reloadable: trueontheir option definitions (defaulting to restart-required when omitted).
ConfigParser.reload()andConfigParser.mergeReloadableOptions(),which merges reloadable options onto the startup explicit inputs and
validates conflicts and implications before applying defaults.
chrome-devtoolsCLI (src/bin/chrome-devtools.ts), setdefaultDescriptioninstead ofdefaulton optional command flags soyargs displays defaults in
--helpwithout populating omitted flags inargv. Only explicitly passed flags are forwarded to the daemon,allowing the daemon's live tool schema and reloadable tool options
(such as
--screenshotFormat) to supply defaults.Stack created with GitHub Stacks CLI • Give Feedback 💬