Repository navigation
feat: resolve config defaults after merging CLI and config file - #2849
Merged
Merged
Conversation
Lightning00Blade
added this pull request to stack #2851
September 28, 2026 08:33
Lightning00Blade
force-pushed
the
cd4a-2-late-defaults
branch
3 times, most recently
from
September 28, 2026 12:43
e17e547 to
93637ef
Compare
Lightning00Blade
force-pushed
the
cd4a-2-late-defaults
branch
from
September 28, 2026 13:09
93637ef to
49a9628
Compare
Lightning00Blade
force-pushed
the
cd4a-2-late-defaults
branch
3 times, most recently
from
September 28, 2026 14:53
129749b to
a1e6200
Compare
Lightning00Blade
force-pushed
the
cd4a-2-late-defaults
branch
from
September 28, 2026 15:09
a1e6200 to
b082140
Compare
Lightning00Blade
force-pushed
the
cd4a-2-late-defaults
branch
2 times, most recently
from
September 28, 2026 20:58
9249a20 to
1be1667
Compare
Lightning00Blade
force-pushed
the
cd4a-2-late-defaults
branch
from
September 28, 2026 21:18
1be1667 to
9ff5e43
Compare
Lightning00Blade
force-pushed
the
cd4a-2-late-defaults
branch
2 times, most recently
from
September 29, 2026 11:13
40253b7 to
69f5c32
Compare
Lightning00Blade
marked this pull request as ready for review
September 29, 2026 11:16
OrKoN
requested changes
Sep 29, 2026
OrKoN
left a comment
Collaborator
There was a problem hiding this comment.
let's consider the following:
- In
src/config/mcp-options.ts(stripYargsPositionalArgsandParsedArguments), remove the(parsed as {_?: unknown})and(parsed as {$0?: unknown})casts (for example by usingdelete parsed._; delete parsed.$0;or destructuring) and omit'_' | '$0'fromParsedArguments.AGENTS.mdforbidsastype casting,Partial<ParsedArguments>already defines_and$0, and keeping them onParsedArgumentsmisrepresents the runtime object afterstripYargsPositionalArgsdeletes them. - In
src/config/mcp-options.ts(parseCliArgs,parseConfigFile, andwithoutDefaults), stripimpliesfrom the per-source yargs passes and validate implications (wsHeaders -> wsEndpoint,experimentalFfmpegPath -> experimentalScreencast,experimentalScreencastFps -> experimentalScreencast) on the mergedexplicitArgs. EvaluatingimpliesoncliArgsandconfigFileArgsin isolation rejects valid split configurations (e.g.,wsEndpointin the config file with--wsHeaderson the CLI) and misses cases where the implied flag is set in the config file but negated on the CLI (--no-experimental-screencast). - In
src/config/mcp-options.ts(getCliOptions), reusewithoutDefaults(getMcpOptionsForViaCli())before deleting the CLI-excluded options instead of duplicating the loop that populatesdefaultDescriptionand deletesdefault. This keeps the default-stripping logic in a single place.
Parse CLI arguments and the JSON config file without yargs defaults so only explicit user intent is captured, merge them with CLI taking precedence, then apply defaults (including the --viaCli ones). Conflict checks now only consider explicitly provided arguments, so implicit defaults such as channel=stable can no longer conflict with explicit flags. Also restores --help/--version exiting via a shared buildCliParser and adds edge-case tests for config parsing, precedence and conflicts.
Lightning00Blade
force-pushed
the
cd4a-2-late-defaults
branch
from
September 29, 2026 12:32
c588f8c to
cac095d
Compare
OrKoN
reviewed
Sep 29, 2026
OrKoN
approved these changes
Sep 29, 2026
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.
Parse CLI arguments and the JSON config file without yargs defaults so only
explicit user intent is captured, merge them with CLI taking precedence, then
apply defaults (including the --viaCli ones). Conflict checks now only consider
explicitly provided arguments, so implicit defaults such as channel=stable can
no longer conflict with explicit flags.
Also restores --help/--version exiting via a shared buildCliParser and adds
edge-case tests for config parsing, precedence and conflicts.
Stack created with GitHub Stacks CLI • Give Feedback 💬