Skip to content

The agent that grows with you

fix(termux): gate uvloop behind optional extra to unblock Android installs

Guillaume D.Isabelle (Ilex)99049aa1f5d0
diff --git a/constraints-termux.txt b/constraints-termux.txt
index dcc1becf64a..1c159d33ccb 100644
--- a/constraints-termux.txt
+++ b/constraints-termux.txt
@@ -5,6 +5,13 @@
#
# These pins keep the tested Android install path stable when upstream packages
# move faster than Termux-compatible wheels / sdists.
+#
+# NOTE: uvloop is excluded from the Termux install path because libuv's
+# ./configure script does not run on Android (non-FHS layout, bionic libc).
+# uvicorn falls back to the stdlib asyncio event loop automatically when
+# uvloop is absent — no performance-critical codepath depends on it.
+# The [uvloop] optional extra is included in [all] but intentionally omitted
+# from [termux] and [termux-all]. See pyproject.toml for details.
ipython<10
jedi>=0.18.1,<0.20
diff --git a/pyproject.toml b/pyproject.toml
index 34c382a6e47..324c3616448 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -127,7 +127,13 @@ dependencies = [
"pathspec==1.1.1",
"fastapi>=0.104.0,<1",
# CIDR-aware forwarded_allow_ips requires uvicorn >=0.31.0.
- "uvicorn[standard]>=0.31.0,<1",
+ # uvicorn's [standard] extra bundles uvloop, httptools, and watchfiles.
+ # uvloop cannot build on Android/Termux (libuv's ./configure fails), so
+ # 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.8.0",
+ "watchfiles>=0.20",
# Streaming multipart uploads for the dashboard file manager (NS-501).
# FastAPI's UploadFile/Form depend on python-multipart; it is NOT pulled in
# by fastapi itself, so the dashboard's multipart upload endpoint would 500
@@ -187,6 +193,12 @@ dependencies = [
]
[project.optional-dependencies]
+# High-performance event loop — uvloop replaces the stdlib asyncio loop with
+# a libuv-backed implementation for ~2-4x throughput on uvicorn. Gated as an
+# 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; sys_platform != 'win32'"]
# 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
@@ -367,7 +379,10 @@ youtube = [
# `hermes dashboard` (localhost SPA + API). Not in core to keep the default install lean.
# starlette==1.3.1 pinned for CVE-2026-48710 (BadHost) — fastapi pulls Starlette
# transitively and pre-1.0.1 is the vulnerable range. See the mcp extra above.
-web = ["fastapi==0.133.1", "uvicorn[standard]==0.41.0", "starlette==1.3.1", "python-multipart==0.0.32"]
+# uvicorn pin without [standard] — httptools / watchfiles are now core deps,
+# and uvloop is gated behind the [uvloop] extra. This keeps [web] safe for
+# termux-all which includes it.
+web = ["fastapi==0.133.1", "uvicorn==0.41.0", "starlette==1.3.1", "python-multipart==0.0.32"]
all = [
# Policy (2026-05-12): `[all]` includes only extras that genuinely
# CAN'T be lazy-installed via `tools/lazy_deps.py` — i.e. things every
@@ -393,6 +408,7 @@ all = [
"hermes-agent[cron]",
"hermes-agent[pty]",
"hermes-agent[mcp]",
+ "hermes-agent[uvloop]",
"hermes-agent[homeassistant]",
"hermes-agent[sms]",
"hermes-agent[acp]",