Skip to content

The agent that grows with you

fix(cli): keep Termux startup hints out of gateway policy

Teknium31dc5078fa42
diff --git a/hermes_cli/main.py b/hermes_cli/main.py
index 370f707243e..72412de7e34 100644
--- a/hermes_cli/main.py
+++ b/hermes_cli/main.py
@@ -3068,15 +3068,9 @@ def _try_termux_fast_cli_launch() -> bool:
_promote_top_level_resume(args)
if args.command in {None, "chat"}:
_set_chat_arg_defaults(args)
- interactive_prompt = not getattr(args, "query", None) and not getattr(args, "image", None)
- if interactive_prompt:
- # Reach the prompt first; agent-only discovery on the first turn.
- setattr(args, "compact", True)
- os.environ["HERMES_DEFER_AGENT_STARTUP"] = "1"
- os.environ["HERMES_FAST_STARTUP_BANNER"] = "1"
- if getattr(args, "accept_hooks", False):
- os.environ["HERMES_ACCEPT_HOOKS"] = "1"
- else:
+ # The gateway owns agent startup; legacy banner hints must not become
+ # execution options or leak into a newly ensured owner.
+ if getattr(args, "query", None) or getattr(args, "image", None):
_prepare_agent_startup(args)
cmd_chat(args)
return True
diff --git a/tests/hermes_cli/test_termux_gateway_launch.py b/tests/hermes_cli/test_termux_gateway_launch.py
new file mode 100644
index 00000000000..e0f6068c283
--- /dev/null
+++ b/tests/hermes_cli/test_termux_gateway_launch.py
@@ -0,0 +1,21 @@
+"""Termux startup hints must not become unsupported execution options."""
+import sys
+
+
+def test_termux_fast_launch_preserves_gateway_execution_options(monkeypatch):
+ from hermes_cli import main
+ from hermes_cli.gateway_chat import validate_options
+
+ monkeypatch.setenv("TERMUX_VERSION", "fixture")
+ monkeypatch.delenv("HERMES_TERMUX_DISABLE_FAST_CLI", raising=False)
+ monkeypatch.setattr(sys, "argv", ["hermes", "--cli"])
+ launches = []
+
+ def launch(args):
+ validate_options(args)
+ launches.append(args)
+
+ monkeypatch.setattr(main, "cmd_chat", launch)
+ assert main._try_termux_fast_cli_launch()
+ assert len(launches) == 1
+ assert not getattr(launches[0], "compact", False)