When a user runs `hermes -w -c Pokemon Agent Dev` without quoting the session name, argparse would fail with: error: argument command: invalid choice: 'Agent' This is because argparse parses `-c Pokemon` (consuming one token via nargs='?'), then sees 'Agent' and tries to match it as a subcommand. Fix: add _coalesce_session_name_args() that pre-processes sys.argv before argparse, joining consecutive non-flag, non-subcommand tokens after -c or -r into a single argument. This makes both quoted and unquoted multi-word session names work transparently. Includes 17 tests covering all edge cases: multi-word names, single-word, bare flags, flag ordering, subcommand boundaries, and passthrough.
99 KiB
99 KiB