When --yolo, -w, -s, -r, -c, and --pass-session-id exist on both the parent parser and the 'chat' subparser with explicit defaults (default=False or default=None), argparse's subparser initialization overwrites the parent's parsed value. So 'hermes --yolo chat' silently drops --yolo, making it appear broken. Fix: use default=argparse.SUPPRESS on all duplicated arguments in the chat subparser. SUPPRESS means 'don't set this attribute if the user didn't explicitly provide it', so the parent parser's value survives through. Affected flags: --yolo, --worktree/-w, --skills/-s, --pass-session-id, --resume/-r, --continue/-c. Adds 15 regression tests covering flag-before-subcommand, flag-after-subcommand, no-subcommand, and env var propagation scenarios.
214 KiB
214 KiB