Skip to content

Commit 8a9441b

Browse files
author
LittleCoinCoin
committed
fix(cli): prevent unwanted defaults
Prevent unwanted defaults for enabled/disabled MCP config parameters. Root cause: argparse's store_true action defaults to False when flag is not provided, making 'not provided' indistinguishable from 'explicitly false'. This caused enabled/disabled parameters to be injected into Omni model even when user didn't specify them, resulting in unexpected config updates. Solution: Set default=None for --enabled (Codex) and --disabled (Kiro) flags so that absence is represented as None and doesn't get included in the Omni payload. The fix enables tri-state behavior: - Omitted flag → None → not added to Omni → not included in host config - Provided flag → True → added to Omni → included in host config This prevents unwanted value flips during partial updates and eliminates false UNSUPPORTED warnings when these flags aren't used.
1 parent e7fe043 commit 8a9441b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hatch/cli_hatch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,7 @@ def main():
16711671
mcp_configure_parser.add_argument(
16721672
"--disabled",
16731673
action="store_true",
1674+
default=None,
16741675
help="Disable the MCP server [hosts: kiro]"
16751676
)
16761677
mcp_configure_parser.add_argument(
@@ -1703,6 +1704,7 @@ def main():
17031704
mcp_configure_parser.add_argument(
17041705
"--enabled",
17051706
action="store_true",
1707+
default=None,
17061708
help="Enable the MCP server [hosts: codex]"
17071709
)
17081710
mcp_configure_parser.add_argument(

0 commit comments

Comments
 (0)