From e3461e0b2ac7aaef91dc0ab4103e0e52341056f1 Mon Sep 17 00:00:00 2001 From: ChanlerDev Date: Mon, 27 Apr 2026 02:44:48 +0800 Subject: [PATCH] fix(cli): remove dead 'q' check from quit command resolution The 'q' alias is defined for 'queue' command in commands.py:93. The hardcoded 'q' in cli.py:5910 was dead code - resolve_command('q') returns the queue CommandDef, so canonical would never be 'q'. Removes the misleading check without changing any behavior: - /quit and /exit still exit (defined aliases) - /q still maps to queue (as intended) --- cli.py | 2 +- tests/cli/test_cli_init.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cli.py b/cli.py index 5f76675b38..617e5c15b1 100644 --- a/cli.py +++ b/cli.py @@ -6282,7 +6282,7 @@ class HermesCLI: _cmd_def = _resolve_cmd(_base_word) canonical = _cmd_def.name if _cmd_def else _base_word - if canonical in ("quit", "exit", "q"): + if canonical in ("quit", "exit"): return False elif canonical == "help": self.show_help() diff --git a/tests/cli/test_cli_init.py b/tests/cli/test_cli_init.py index e0fa9e4c23..d2d6398b96 100644 --- a/tests/cli/test_cli_init.py +++ b/tests/cli/test_cli_init.py @@ -123,6 +123,13 @@ class TestBusyInputMode: cli.process_command("/queue follow up") assert cli._pending_input.get_nowait() == "follow up" + def test_q_alias_queues_prompt(self): + """The /q alias should resolve to /queue, not /quit.""" + cli = _make_cli() + cli._agent_running = False + assert cli.process_command("/q follow up") is True + assert cli._pending_input.get_nowait() == "follow up" + def test_queue_mode_routes_busy_enter_to_pending(self): """In queue mode, Enter while busy should go to _pending_input, not _interrupt_queue.""" cli = _make_cli(config_overrides={"display": {"busy_input_mode": "queue"}})