Skip to content

[Bug]: [platform.matrix] Matrix gateway blocked on macOS arm64 with E2EE off — _is_satisfied() ignores the [encryption] extra, so a mautrix pin-drift forces an unneeded python-olm build #62401

Description

@mr-penner

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:

  1. 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.
  2. 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

  1. Apple Silicon Mac, pip install of Hermes 0.18.2.
  2. hermes gateway setup → Matrix, answer No to E2EE.
  3. 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)

  1. Make encryption conditional. Split the group: platform.matrixmautrix==0.21.0 + aiosqlite/asyncpg/aiohttp-socks/aiohttp; add platform.matrix.e2eemautrix[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.
  2. Fix Defect 3 by routing the wizard through the E2EE-aware group (or actually using matrix_pkg) so "no E2EE" never pulls olm.
  3. 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.
  4. Optionally, have _is_satisfied() verify the [extras] too (check python-olm presence when the spec carries [encryption]), so the check matches what install enforces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/configConfig system, migrations, profilescomp/pluginsPlugin system and bundled pluginscomp/toolsTool registry, model_tools, toolsetsplatform/matrixMatrix adapter (E2EE)type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions