fix: initialize CLI voice state for single-query mode

- initialize voice and interrupt runtime state in HermesCLI.__init__
- prevent chat -q from crashing before run() has executed
- add regression coverage for single-query state initialization
This commit is contained in:
teknium1 2026-03-14 06:31:32 -07:00
parent 7b10881b9e
commit 9633ddd8d8
2 changed files with 41 additions and 0 deletions

View file

@ -95,6 +95,17 @@ class TestVerboseAndToolProgress:
assert cli.tool_progress_mode in ("off", "new", "all", "verbose")
class TestSingleQueryState:
def test_voice_and_interrupt_state_initialized_before_run(self):
"""Single-query mode calls chat() without going through run()."""
cli = _make_cli()
assert cli._voice_tts is False
assert cli._voice_mode is False
assert cli._voice_tts_done.is_set()
assert hasattr(cli, "_interrupt_queue")
assert hasattr(cli, "_pending_input")
class TestHistoryDisplay:
def test_history_numbers_only_visible_messages_and_summarizes_tools(self, capsys):
cli = _make_cli()