The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(cli): only chat/rl may prompt for hook consent; cron tick and mcp serve never do
Teknium81d4f8d3c1e5
diff --git a/hermes_cli/main.py b/hermes_cli/main.pyindex fc37d2549b4..7c5e4e644ec 100644--- a/hermes_cli/main.py+++ b/hermes_cli/main.py@@ -2988,7 +2988,7 @@ def _prepare_agent_startup(args) -> None:from agent.outbound_webhooks import register_from_config as register_outbound_webhooks_hooks_cfg = load_config()- register_from_config(_hooks_cfg, accept_hooks=_accept_hooks, interactive=args.command != "gateway")+ register_from_config(_hooks_cfg, accept_hooks=_accept_hooks, interactive=args.command in {None, "chat", "rl"})if _accept_hooks and args.command == "gateway": # every session-open re-sync keeps honouring itfrom agent.shell_hooks import accept_for_processaccept_for_process()diff --git a/tests/hermes_cli/test_cli_startup_trim.py b/tests/hermes_cli/test_cli_startup_trim.pyindex 648e94367d7..a414b0c0fe8 100644--- a/tests/hermes_cli/test_cli_startup_trim.py+++ b/tests/hermes_cli/test_cli_startup_trim.py@@ -58,6 +58,9 @@ def test_non_chat_agent_command_still_registers_hooks(monkeypatch):@pytest.mark.parametrize(("command", "subcommand", "interactive"), [("gateway", {"gateway_command": "run"}, False), # a service: a hidden console is not a person (#127822)+ ("cron", {"cron_command": "tick"}, False), # scheduled: nobody at the console+ ("mcp", {"mcp_action": "serve"}, False), # stdin carries the protocol stream+ ("acp", {}, False), # stdin carries the protocol stream("rl", {}, True), # a foreground command may still ask at its terminal])def test_only_foreground_commands_may_prompt_for_hook_consent(monkeypatch, command, subcommand, interactive):