Skip to content

chore(config): support reloadable configurations - #3048

Merged
Lightning00Blade merged 1 commit into
mainfrom
cd4a-config/4a-reload-options
Oct 14, 2026
Merged

Lightning00Blade merged 1 commit into
mainfrom
cd4a-config/4a-reload-options

Conversation

@Lightning00Blade

@Lightning00Blade Lightning00Blade commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator
  • Mark options that can be updated at runtime with reloadable: true on
    their option definitions (defaulting to restart-required when omitted).
  • Add ConfigParser.reload() and ConfigParser.mergeReloadableOptions(),
    which merges reloadable options onto the startup explicit inputs and
    validates conflicts and implications before applying defaults.
  • In the chrome-devtools CLI (src/bin/chrome-devtools.ts), set
    defaultDescription instead of default on optional command flags so
    yargs displays defaults in --help without populating omitted flags in
    argv. 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 💬

@Lightning00Blade
Lightning00Blade force-pushed the cd4a-config/4a-reload-options branch 6 times, most recently from 5363a8d to 10c59be Compare October 13, 2026 17:40
@Lightning00Blade
Lightning00Blade marked this pull request as ready for review October 14, 2026 11:13

@OrKoN OrKoN left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the following:

  1. Move experimentalDevtools into RESTART_REQUIRED_OPTIONS (src/config/mcp-options.ts) and drop it from the "applies reloadable options" test in tests/config/mcp-options.test.ts. BrowserManager destructures it as devtools when launching Chrome, so changing it after startup silently has no effect on the running browser.

  2. Replace the deny-list with an explicit per-option reloadable flag (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.

  3. Make ConfigParser.mergeReloadableOptions (src/config/ConfigParser.ts) merge and validate explicit inputs before applyDefaults, rather than running validateConflicts / validateImplications on fully defaulted ParsedArguments. The step-4 contract says "Only explicit inputs are checked, so defaults never conflict"; validating resolved args breaks that, and the new filesystemRoot skip in applyDefaults is a workaround for exactly this that also changes non-reload startup output.

  4. Stub the locator in the parseArgs helper of the mergeReloadableOptions tests (tests/config/mcp-options.test.ts) and pass exitProcess = false. With env = {} the real ConfigLocator falls back to ~/.config/cd4a/config.json, so the tests depend on the developer's machine and a parse error would call process.exit inside the test runner.

  5. Split the options.defaultDescription = JSON.stringify(opt.default) change in src/bin/chrome-devtools.ts into 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 the argName in argv forwarding loop then omits those args, so the daemon-side command handler must now apply defaults itself.

  6. Update the PR title and add a description. ConfigParser.reload() already exists on main; this PR adds mergeReloadableOptions and RESTART_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.

@Lightning00Blade
Lightning00Blade force-pushed the cd4a-config/4a-reload-options branch from 10c59be to 9b13959 Compare October 14, 2026 13:17
@OrKoN

OrKoN commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

This does not implement reload() as the title says?

@Lightning00Blade Lightning00Blade changed the title feat(config): classify reloadable options and add ConfigParser.reload() chore(config): support reloadable configurations Oct 14, 2026
@Lightning00Blade
Lightning00Blade added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit c84b687 Oct 14, 2026
24 checks passed
@Lightning00Blade
Lightning00Blade deleted the cd4a-config/4a-reload-options branch October 14, 2026 14:23
zjdCander pushed a commit to zjdCander/chrome-devtools-mcp that referenced this pull request Oct 19, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants