Bug: Matrix gateway unusable on macOS arm64 with E2EE off — lazy-dep pins mautrix[encryption]==0.21.0, forcing a python-olm build that isn't needed
Repo: NousResearch/hermes-agent
Version: Hermes Agent v0.18.2 (2026.7.7.2), commit 5e849942
Platform: macOS 15 (Apple Silicon / arm64), Python 3.11, install method pip
E2EE: off (MATRIX_E2EE_MODE unset → resolves to off)
Summary
On Apple Silicon, the Matrix gateway cannot be brought up even when E2EE is disabled, because the lazy-dependency group for platform.matrix unconditionally pins mautrix[encryption]==0.21.0. The [encryption] extra pulls python-olm, which has no macOS arm64 wheel and fails to build from sdist against clang (const-qualified 'other_pos'). Since E2EE is off, python-olm is never imported at runtime — the requirement is spurious for this configuration.
There are three distinct defects that combine to produce this:
Defect 1 — platform.matrix requires the encryption extra unconditionally
tools/lazy_deps.py:
"platform.matrix": (
"mautrix[encryption]==0.21.0", # <-- [encryption] pulls python-olm always
"aiosqlite==0.22.1",
"asyncpg==0.31.0",
"aiohttp-socks==0.11.0",
"aiohttp==3.14.1",
),
The runtime adapter only imports mautrix.crypto / olm behind if self._encryption: (plugins/platforms/matrix/adapter.py:1278), and _check_e2ee_deps() (adapter.py:489) already degrades gracefully when olm is absent. So plain mautrix is sufficient with E2EE off — but the lazy installer never lets you get there.
Defect 2 — _is_satisfied() never actually checks python-olm, only the bare mautrix version
tools/lazy_deps.py:509 _is_satisfied("mautrix[encryption]==0.21.0"):
_pkg_name_from_spec() strips the extra → checks package mautrix only.
- The
[encryption] extra (i.e. whether python-olm is present) is never verified.
Two consequences:
- Over-eager reinstall on patch drift. With
mautrix==0.21.1 installed and the pin at ==0.21.0, Version("0.21.1") in SpecifierSet("==0.21.0") is False, so the group is reported "missing" and a reinstall of mautrix[encryption]==0.21.0 is triggered — which is what invokes the olm build. The failure is thus gated on a version-pin mismatch, not on any real encryption requirement.
- Under-checking. Because the satisfaction check ignores olm entirely,
mautrix[encryption]==0.21.0 reports "satisfied" as soon as bare mautrix==0.21.0 exists, even with no olm installed. The [encryption] intent is simultaneously enforced at install time and unverified at check time.
Defect 3 — matrix_pkg in the setup wizard is cosmetic
plugins/platforms/matrix/adapter.py:4480:
matrix_pkg = "mautrix[encryption]" if want_e2ee else "mautrix" # computed…
...
_lazy_ensure("platform.matrix", prompt=False) # …but ignored
matrix_pkg is only used for log/print strings and an ImportError fallback. The primary path calls _lazy_ensure("platform.matrix"), which uses the hardcoded LAZY_DEPS entry with [encryption] regardless of want_e2ee. So answering "no" to "Enable E2EE?" in hermes gateway setup still tries to install the encryption extra and still fails on olm.
Reproduction
- Apple Silicon Mac,
pip install of Hermes 0.18.2.
hermes gateway setup → Matrix, answer No to E2EE.
hermes gateway run.
Observed (logs/errors.log):
WARNING matrix_platform.adapter: Matrix: required packages not installed (mautrix[encryption]==0.21.0).
ERROR gateway.run: Platform 'matrix' is registered but adapter creation failed
WARNING gateway.run: No adapter available for matrix
Impact
Matrix is effectively unavailable on macOS arm64 for the common E2EE-off case. The docs/gating only exclude Matrix on Windows (_unsupported_feature_reason, lazy_deps.py:465); macOS hits the same olm-build wall with no gate and no non-E2EE escape hatch.
Workaround (verified working)
Install the pinned mautrix without the extra so every platform.matrix spec is satisfied and no olm build is attempted:
<venv>/bin/pip install 'mautrix==0.21.0'
After this, feature_missing('platform.matrix') is empty, hermes gateway run reports ✓ matrix connected / logged in as @…, and the gateway runs on plain mautrix with E2EE off. No compiler is invoked.
Related issues (not duplicates — different function / platform)
Suggested fixes (any of)
- Make encryption conditional. Split the group:
platform.matrix → mautrix==0.21.0 + aiosqlite/asyncpg/aiohttp-socks/aiohttp; add platform.matrix.e2ee → mautrix[encryption]==0.21.0 (i.e. python-olm). Only ensure() the e2ee group when the resolved E2EE mode is optional/required. This matches the intent already encoded by want_e2ee / matrix_pkg.
- Fix Defect 3 by routing the wizard through the E2EE-aware group (or actually using
matrix_pkg) so "no E2EE" never pulls olm.
- Relax the pin from
==0.21.0 to e.g. >=0.21,<0.22 so a patch bump (0.21.1) doesn't force a reinstall — mitigates Defect 2's over-eager path.
- Optionally, have
_is_satisfied() verify the [extras] too (check python-olm presence when the spec carries [encryption]), so the check matches what install enforces.
Bug: Matrix gateway unusable on macOS arm64 with E2EE off — lazy-dep pins
mautrix[encryption]==0.21.0, forcing apython-olmbuild that isn't neededRepo: NousResearch/hermes-agent
Version: Hermes Agent v0.18.2 (2026.7.7.2), commit
5e849942Platform: macOS 15 (Apple Silicon / arm64), Python 3.11, install method
pipE2EE: off (
MATRIX_E2EE_MODEunset → resolves tooff)Summary
On Apple Silicon, the Matrix gateway cannot be brought up even when E2EE is disabled, because the lazy-dependency group for
platform.matrixunconditionally pinsmautrix[encryption]==0.21.0. The[encryption]extra pullspython-olm, which has no macOS arm64 wheel and fails to build from sdist against clang (const-qualified 'other_pos'). Since E2EE is off,python-olmis never imported at runtime — the requirement is spurious for this configuration.There are three distinct defects that combine to produce this:
Defect 1 —
platform.matrixrequires the encryption extra unconditionallytools/lazy_deps.py:The runtime adapter only imports
mautrix.crypto/ olm behindif self._encryption:(plugins/platforms/matrix/adapter.py:1278), and_check_e2ee_deps()(adapter.py:489) already degrades gracefully when olm is absent. So plainmautrixis sufficient with E2EE off — but the lazy installer never lets you get there.Defect 2 —
_is_satisfied()never actually checkspython-olm, only the baremautrixversiontools/lazy_deps.py:509_is_satisfied("mautrix[encryption]==0.21.0"):_pkg_name_from_spec()strips the extra → checks packagemautrixonly.[encryption]extra (i.e. whetherpython-olmis present) is never verified.Two consequences:
mautrix==0.21.1installed and the pin at==0.21.0,Version("0.21.1") in SpecifierSet("==0.21.0")isFalse, so the group is reported "missing" and a reinstall ofmautrix[encryption]==0.21.0is triggered — which is what invokes the olm build. The failure is thus gated on a version-pin mismatch, not on any real encryption requirement.mautrix[encryption]==0.21.0reports "satisfied" as soon as baremautrix==0.21.0exists, even with no olm installed. The[encryption]intent is simultaneously enforced at install time and unverified at check time.Defect 3 —
matrix_pkgin the setup wizard is cosmeticplugins/platforms/matrix/adapter.py:4480:matrix_pkgis only used for log/print strings and anImportErrorfallback. The primary path calls_lazy_ensure("platform.matrix"), which uses the hardcodedLAZY_DEPSentry with[encryption]regardless ofwant_e2ee. So answering "no" to "Enable E2EE?" inhermes gateway setupstill tries to install the encryption extra and still fails on olm.Reproduction
pipinstall of Hermes 0.18.2.hermes gateway setup→ Matrix, answer No to E2EE.hermes gateway run.Observed (
logs/errors.log):Impact
Matrix is effectively unavailable on macOS arm64 for the common E2EE-off case. The docs/gating only exclude Matrix on Windows (
_unsupported_feature_reason,lazy_deps.py:465); macOS hits the same olm-build wall with no gate and no non-E2EE escape hatch.Workaround (verified working)
Install the pinned mautrix without the extra so every
platform.matrixspec is satisfied and no olm build is attempted:After this,
feature_missing('platform.matrix')is empty,hermes gateway runreports✓ matrix connected/logged in as @…, and the gateway runs on plain mautrix with E2EE off. No compiler is invoked.Related issues (not duplicates — different function / platform)
lazy_deps.py+platform.matrix, but its root cause isactive_features()false-positiving on the sharedaiohttp==3.14.1pin, and its build failure isthe Windows
make/olm path. This report is a different code path (_is_satisfied()ignoring the[encryption]extra → amautrixversion-pin drift forces a reinstall) on macOS, for a user whohas enabled Matrix and wants it E2EE-off. The two share a theme (lazy-dep group pulls olm when it
shouldn't) and a fix would likely be coordinated.
python-olmsource build vs CMake 4.x on Windows. Same olm-build wall,different trigger/platform; the E2EE-off cases here would sidestep olm entirely under fix Terminal tool #1 below.
implemented-on-main) — the oldmatrix-nio[e2e]packaging/h11conflict onmacOS. Superseded by the current
mautrix-based stack; listed only to pre-empt "isn't this Matrix/E2EE extra does not resolve cleanly on macOS/Python 3.11 #6931?".Suggested fixes (any of)
platform.matrix→mautrix==0.21.0+aiosqlite/asyncpg/aiohttp-socks/aiohttp; addplatform.matrix.e2ee→mautrix[encryption]==0.21.0(i.e.python-olm). Onlyensure()the e2ee group when the resolved E2EE mode isoptional/required. This matches the intent already encoded bywant_e2ee/matrix_pkg.matrix_pkg) so "no E2EE" never pulls olm.==0.21.0to e.g.>=0.21,<0.22so a patch bump (0.21.1) doesn't force a reinstall — mitigates Defect 2's over-eager path._is_satisfied()verify the[extras]too (checkpython-olmpresence when the spec carries[encryption]), so the check matches what install enforces.