fix(cli): keep quiet prompts interactive

This commit is contained in:
embwl0x
2026-08-09 01:53:20 -06:00
committed by Teknium
parent 55e7ecd260
commit 6f85df97fd
2 changed files with 12 additions and 5 deletions
-1
View File
@@ -12744,7 +12744,6 @@ def _guard_noninteractive_user_config(args) -> None:
is_noninteractive = (
bool(getattr(args, "oneshot", None))
or bool(getattr(args, "query", None))
or bool(getattr(args, "quiet", False))
)
if not is_noninteractive:
return
@@ -38,9 +38,9 @@ def _isolated_config_env(monkeypatch, tmp_path):
[
_args(query="hello"),
_args(command=None, query=None, oneshot="hello"),
_args(query=None, quiet=True),
_args(query="hello", quiet=True),
],
ids=["single-query", "oneshot", "quiet"],
ids=["single-query", "oneshot", "quiet-query"],
)
def test_noninteractive_guard_rejects_malformed_yaml(args, tmp_path, caplog, capsys):
from hermes_cli import main as main_mod
@@ -146,11 +146,19 @@ def test_interactive_chat_keeps_existing_repair_behavior(tmp_path):
assert list(tmp_path.glob("config.yaml.corrupt.*.bak")) == []
def test_empty_query_keeps_interactive_repair_behavior(tmp_path):
@pytest.mark.parametrize(
"args",
[
_args(query=""),
_args(query=None, quiet=True),
_args(query="", quiet=True),
],
ids=["empty-query", "quiet", "quiet-empty-query"],
)
def test_queryless_chat_keeps_interactive_repair_behavior(args, tmp_path):
from hermes_cli import main as main_mod
(tmp_path / "config.yaml").write_text("model: [unterminated\n")
args = _args(query="")
main_mod._guard_noninteractive_user_config(args)