Skip to content

The agent that grows with you

fix(termux): policy pins, full uvloop marker, lazy dashboard mirror, lock

teknium1536e88673c0a
diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py
index 288404f87e1..e89b78ed094 100644
--- a/hermes_cli/web_server.py
+++ b/hermes_cli/web_server.py
@@ -52,7 +52,7 @@ except ImportError:
except Exception:
raise SystemExit(
"Web UI requires fastapi and uvicorn.\n"
- f"Install with: {sys.executable} -m pip install 'fastapi' 'uvicorn[standard]'"
+ f"Install with: {sys.executable} -m pip install 'fastapi' 'uvicorn'"
)
WEB_DIST = Path(os.environ["HERMES_WEB_DIST"]) if "HERMES_WEB_DIST" in os.environ else Path(__file__).parent / "web_dist"
diff --git a/pyproject.toml b/pyproject.toml
index 0a3e7666025..f487128d79e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -132,7 +132,7 @@ dependencies = [
# we declare the working components inline and gate uvloop behind the
# [uvloop] optional extra — desktop/server profiles pull it via [all].
"uvicorn>=0.31.0,<1",
- "httptools>=0.6.0,<1",
+ "httptools>=0.6.3,<0.9",
"watchfiles>=0.20,<2",
# Streaming multipart uploads for the dashboard file manager (NS-501).
# FastAPI's UploadFile/Form depend on python-multipart; it is NOT pulled in
@@ -198,7 +198,9 @@ dependencies = [
# optional extra because libuv's ./configure does not run on Android/Termux
# (bionic libc, non-FHS layout). Desktop and server installs pull this via
# [all]; the [termux] / [termux-all] profiles intentionally omit it.
-uvloop = ["uvloop>=0.15.1,<1; sys_platform != 'win32'"]
+uvloop = [
+ "uvloop>=0.15.1,<0.24; sys_platform != 'win32' and sys_platform != 'cygwin' and sys_platform != 'android' and platform_python_implementation != 'PyPy'",
+]
# Native Anthropic provider — only needed when provider=anthropic (not via
# OpenRouter or other aggregators).
anthropic = ["anthropic==0.87.0"] # CVE-2026-34450, CVE-2026-34452
diff --git a/tests/test_packaging_metadata.py b/tests/test_packaging_metadata.py
index 4b7e5373476..1c87155d3e5 100644
--- a/tests/test_packaging_metadata.py
+++ b/tests/test_packaging_metadata.py
@@ -434,3 +434,51 @@ def test_security_pins_present_in_mirrored_lazy_features():
"pyproject extras — the lazy install path would not enforce the "
"CVE-patched floor:\n " + "\n ".join(problems)
)
+
+
+def _extra_closure(extras: dict, name: str) -> set:
+ """Names of every extra reachable from ``hermes-agent[name]`` self-references."""
+ seen, todo = set(), [name]
+ while todo:
+ cur = todo.pop()
+ if cur in seen:
+ continue
+ seen.add(cur)
+ for spec in extras.get(cur, ()):
+ if _distribution_name(spec) == "hermes-agent":
+ todo.extend(spec.split("[", 1)[1].split("]", 1)[0].split(","))
+ return seen
+
+
+def test_termux_install_paths_never_request_uvloop():
+ """uvloop's bundled libuv does not configure on Android/Termux (#116016).
+
+ Core must not request ``uvicorn[standard]`` (that extra pulls uvloop on
+ every non-Windows CPython), and neither Termux profile may reach the
+ opt-in ``uvloop`` extra through any chain of ``hermes-agent[...]``
+ self-references. The lazy dashboard install mirrors the same rule.
+ """
+ from tools.lazy_deps import LAZY_DEPS
+
+ project = tomllib.loads((REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8"))["project"]
+ extras = project["optional-dependencies"]
+ for group in (project["dependencies"], extras["web"], LAZY_DEPS["tool.dashboard"]):
+ for spec in group:
+ assert _distribution_name(spec) != "uvloop", spec
+ assert not (_distribution_name(spec) == "uvicorn" and "[" in spec), (
+ f"{spec!r} requests a uvicorn extra; uvicorn[standard] drags uvloop onto Termux"
+ )
+ for profile in ("termux", "termux-all"):
+ assert "uvloop" not in _extra_closure(extras, profile), profile
+
+
+def test_all_extra_keeps_uvloop_opt_in_off_android():
+ """``[all]`` still ships the libuv loop, but only where it can build."""
+ project = tomllib.loads((REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8"))["project"]
+ extras = project["optional-dependencies"]
+ assert "uvloop" in _extra_closure(extras, "all")
+ (spec,) = extras["uvloop"]
+ marker = spec.split(";", 1)[1]
+ assert _distribution_name(spec) == "uvloop"
+ for platform in ("win32", "cygwin", "android"):
+ assert f"sys_platform != '{platform}'" in marker, marker
diff --git a/tools/lazy_deps.py b/tools/lazy_deps.py
index 0811ab302bd..675dd5d21f8 100644
--- a/tools/lazy_deps.py
+++ b/tools/lazy_deps.py
@@ -185,7 +185,7 @@ LAZY_DEPS: dict[str, tuple[str, ...]] = {
"tool.acp": ("agent-client-protocol==0.9.0",),
"tool.dashboard": (
"fastapi==0.133.1",
- "uvicorn[standard]==0.41.0",
+ "uvicorn==0.41.0",
"starlette==1.3.1",
"python-multipart==0.0.32", # FastAPI UploadFile/Form streaming uploads
),
diff --git a/uv.lock b/uv.lock
index 6d381729736..41b83576c45 100644
--- a/uv.lock
+++ b/uv.lock
@@ -1740,6 +1740,7 @@ dependencies = [
{ name = "fastapi" },
{ name = "fire" },
{ name = "firecrawl-anydoc" },
+ { name = "httptools" },
{ name = "httpx", extra = ["socks"] },
{ name = "jinja2" },
{ name = "markdown" },
@@ -1766,7 +1767,8 @@ dependencies = [
{ name = "tenacity" },
{ name = "tzdata", marker = "sys_platform == 'win32'" },
{ name = "urllib3" },
- { name = "uvicorn", extra = ["standard"] },
+ { name = "uvicorn" },
+ { name = "watchfiles" },
{ name = "websockets" },
]
@@ -1788,7 +1790,8 @@ all = [
{ name = "pyasn1" },
{ name = "python-multipart" },
{ name = "starlette" },
- { name = "uvicorn", extra = ["standard"] },
+ { name = "uvicorn" },
+ { name = "uvloop", marker = "platform_python_implementation != 'PyPy' and sys_platform != 'android' and sys_platform != 'cygwin' and sys_platform != 'win32'" },
{ name = "youtube-transcript-api" },
]
anthropic = [
@@ -1942,11 +1945,14 @@ termux-all = [
{ name = "python-multipart" },
{ name = "python-telegram-bot", extra = ["webhooks"] },
{ name = "starlette" },
- { name = "uvicorn", extra = ["standard"] },
+ { name = "uvicorn" },
]
tts-premium = [
{ name = "elevenlabs" },
]
+uvloop = [
+ { name = "uvloop", marker = "platform_python_implementation != 'PyPy' and sys_platform != 'android' and sys_platform != 'cygwin' and sys_platform != 'win32'" },
+]
vercel = [
{ name = "vercel" },
]
@@ -1972,7 +1978,7 @@ web = [
{ name = "fastapi" },
{ name = "python-multipart" },
{ name = "starlette" },
- { name = "uvicorn", extra = ["standard"] },
+ { name = "uvicorn" },
]
wecom = [
{ name = "defusedxml" },
@@ -2044,6 +2050,7 @@ requires-dist = [
{ name = "hermes-agent", extras = ["sms"], marker = "extra == 'all'" },
{ name = "hermes-agent", extras = ["sms"], marker = "extra == 'termux-all'" },
{ name = "hermes-agent", extras = ["termux"], marker = "extra == 'termux-all'" },
+ { name = "hermes-agent", extras = ["uvloop"], marker = "extra == 'all'" },
{ name = "hermes-agent", extras = ["web"], marker = "extra == 'all'" },
{ name = "hermes-agent", extras = ["web"], marker = "extra == 'termux-all'" },
{ name = "hermes-agent", extras = ["youtube"], marker = "extra == 'all'" },
@@ -2051,6 +2058,7 @@ requires-dist = [
{ name = "honcho-ai", marker = "extra == 'honcho'", specifier = "==2.2.0" },
{ name = "httplib2", marker = "extra == 'google'", specifier = "==0.32.0" },
{ name = "httplib2", marker = "extra == 'google-chat'", specifier = "==0.32.0" },
+ { name = "httptools", specifier = ">=0.6.3,<0.9" },
{ name = "httpx", extras = ["socks"], specifier = "==0.28.1" },
{ name = "httpx2", marker = "extra == 'computer-use'", specifier = "==2.7.0" },
{ name = "httpx2", marker = "extra == 'dev'", specifier = "==2.7.0" },
@@ -2123,13 +2131,15 @@ requires-dist = [
{ name = "ty", marker = "extra == 'dev'", specifier = "==0.0.21" },
{ name = "tzdata", marker = "sys_platform == 'win32'", specifier = "==2025.3" },
{ name = "urllib3", specifier = ">=2.7.0,<3" },
- { name = "uvicorn", extras = ["standard"], specifier = ">=0.31.0,<1" },
- { name = "uvicorn", extras = ["standard"], marker = "extra == 'web'", specifier = "==0.41.0" },
+ { name = "uvicorn", specifier = ">=0.31.0,<1" },
+ { name = "uvicorn", marker = "extra == 'web'", specifier = "==0.41.0" },
+ { name = "uvloop", marker = "platform_python_implementation != 'PyPy' and sys_platform != 'android' and sys_platform != 'cygwin' and sys_platform != 'win32' and extra == 'uvloop'", specifier = ">=0.15.1,<0.24" },
{ name = "vercel", marker = "extra == 'vercel'", specifier = "==0.7.2" },
+ { name = "watchfiles", specifier = ">=0.20,<2" },
{ name = "websockets", specifier = "==15.0.1" },
{ name = "youtube-transcript-api", marker = "extra == 'youtube'", specifier = "==1.2.4" },
]
-provides-extras = ["anthropic", "exa", "firecrawl", "parallel-web", "fal", "edge-tts", "modal", "daytona", "vercel", "hindsight", "dev", "messaging", "cron", "slack", "matrix", "wecom", "tts-premium", "voice", "wake", "honcho", "supermemory", "mem0", "vision", "pty", "mcp", "nemo-relay", "homeassistant", "sms", "teams", "computer-use", "acp", "mistral", "otlp", "bedrock", "vertex", "azure-identity", "termux", "termux-all", "dingtalk", "feishu", "google", "google-chat", "youtube", "web", "all"]
+provides-extras = ["uvloop", "anthropic", "exa", "firecrawl", "parallel-web", "fal", "edge-tts", "modal", "daytona", "vercel", "hindsight", "dev", "messaging", "cron", "slack", "matrix", "wecom", "tts-premium", "voice", "wake", "honcho", "supermemory", "mem0", "vision", "pty", "mcp", "nemo-relay", "homeassistant", "sms", "teams", "computer-use", "acp", "mistral", "otlp", "bedrock", "vertex", "azure-identity", "termux", "termux-all", "dingtalk", "feishu", "google", "google-chat", "youtube", "web", "all"]
[[package]]
name = "hf-xet"
@@ -4863,17 +4873,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/83/e4/d04a086285c20886c0daad0e026f250869201013d18f81d9ff5eada73a88/uvicorn-0.41.0-py3-none-any.whl", hash = "sha256:29e35b1d2c36a04b9e180d4007ede3bcb32a85fbdfd6c6aeb3f26839de088187", size = 68783, upload-time = "2026-02-16T23:07:22.357Z" },
]
-[package.optional-dependencies]
-standard = [
- { name = "colorama", marker = "sys_platform == 'win32'" },
- { name = "httptools" },
- { name = "python-dotenv" },
- { name = "pyyaml" },
- { name = "uvloop", marker = "platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'" },
- { name = "watchfiles" },
- { name = "websockets" },
-]
-
[[package]]
name = "uvloop"
version = "0.22.1"
diff --git a/website/docs/getting-started/termux.md b/website/docs/getting-started/termux.md
index df94ba95708..9fdeb4ed2f0 100644
--- a/website/docs/getting-started/termux.md
+++ b/website/docs/getting-started/termux.md
@@ -261,6 +261,10 @@ export ANDROID_API_LEVEL="$(getprop ro.build.version.sdk)"
python -m pip install -e '.[termux]' -c constraints-termux.txt
```
+### `Failed building wheel for uvloop`
+
+`uvloop` bundles libuv, whose `./configure` does not run on Android. Hermes keeps it out of the core install and of the `termux` / `termux-all` extras — `uvicorn` falls back to the stdlib asyncio loop, which the dashboard and gateway run fine on. If you see this error, you are installing an extra that includes `uvloop` (for example `[all]`): install `.[termux]` or `.[termux-all]` instead.
+
### `hermes doctor` says ripgrep or Node is missing
Install them with Termux packages: