Skip to content

The agent that grows with you

fix(termux): use the current CLI version predicate before dispatch

ethernete6527b2a34b3
diff --git a/hermes_cli/main.py b/hermes_cli/main.py
index 70a2356ef41..85b74c87017 100644
--- a/hermes_cli/main.py
+++ b/hermes_cli/main.py
@@ -3009,7 +3009,7 @@ def _try_termux_fast_cli_launch() -> bool:
if _wants_tui_early(argv): # TUI fast path / full dispatch owns those
return False
- if _startup_fast.is_termux_fast_version_argv(argv):
+ if _startup_fast.is_global_fast_version_argv(argv):
_print_version_info(check_updates=True)
return True
diff --git a/tests/hermes_cli/test_startup_fast_guards.py b/tests/hermes_cli/test_startup_fast_guards.py
index 09eb9624fef..0692edaf609 100644
--- a/tests/hermes_cli/test_startup_fast_guards.py
+++ b/tests/hermes_cli/test_startup_fast_guards.py
@@ -22,6 +22,8 @@ import subprocess
import sys
from pathlib import Path
+import pytest
+
REPO_ROOT = Path(__file__).resolve().parents[2]
# Modules that must NEVER be imported by the fast path. Each one either
@@ -93,3 +95,13 @@ def test_fast_version_reports_install_method_stamp(tmp_path):
result = _run_version({"HERMES_HOME": str(home)})
assert result.returncode == 0, result.stderr
assert "Install method: git" in result.stdout
+
+
[email protected]("argv", [["update"], ["pm", "doctor"], ["gateway", "status"]])
+def test_termux_chat_shortcut_leaves_subcommands_to_dispatch(monkeypatch, argv):
+ from hermes_cli import main
+
+ monkeypatch.setenv("PREFIX", "/data/data/com.termux/files/usr")
+ monkeypatch.delenv("HERMES_TERMUX_DISABLE_FAST_CLI", raising=False)
+ monkeypatch.setattr(sys, "argv", ["hermes", *argv])
+ assert main._try_termux_fast_cli_launch() is False