hermes - ✅(Solved) Fix [Bug]: Bot does not receive messages on fresh Matrix setup (no inbound events, sync stalls) [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#12614Fetched 2026-04-20 12:17:55
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
commented ×1cross-referenced ×1labeled ×1mentioned ×1

Error Message

2026-04-17 16:39:28,898 INFO gateway.platforms.matrix: Matrix: using access token for @REDACTED:matrix.org (device REDACTED) 2026-04-17 16:39:29,705 INFO gateway.platforms.matrix: Matrix: cross-signing verified via recovery key 2026-04-17 16:39:29,706 INFO gateway.platforms.matrix: Matrix: E2EE enabled (store: /home/hermes/.hermes/platforms/matrix/store/crypto.db, device_id=REDACTED) 2026-04-17 16:39:29,963 INFO gateway.platforms.matrix: Matrix: initial sync complete, joined 1 rooms 2026-04-17 16:39:30,033 INFO gateway.platforms.matrix: Matrix: invited to !REDACTED:matrix.org — joining 2026-04-17 16:39:30,172 INFO gateway.platforms.matrix: Matrix: joined !REDACTED:matrix.org 2026-04-17 16:44:34,219 INFO gateway.platforms.matrix: Matrix: disconnected hermes@debian:~/.hermes/logs$ WARNING mau.crypto: No one-time keys nor device keys got when trying to share keys WARNING mau.crypto: No one-time keys nor device keys got when trying to share keys

Fix Action

Fixed

PR fix notes

PR #12803: fix(matrix): detect fresh DMs without stale negative cache

Description (problem / solution / changelog)

Summary

Fix fresh Matrix DM detection so newly joined 1:1 rooms are not misclassified as group rooms that require an explicit mention.

Fixes #12614.

Problem

On fresh Matrix setups, the bot could join rooms successfully but then appear to receive no usable inbound messages.

In practice, fresh 1:1 rooms could be treated as normal group rooms because:

  • m.direct was incomplete or not populated yet
  • local state_store membership was not yet authoritative
  • the adapter cached a negative DM result too early

With the default MATRIX_REQUIRE_MENTION=true, that caused messages to be silently dropped, which looked like the bot was not receiving events.

What changed

  • treat m.direct as a positive DM signal only
  • stop writing negative DM cache entries for rooms merely absent from m.direct
  • only trust state_store.get_members() when has_full_member_list(room_id) is true
  • fall back to get_joined_members() for fresh rooms with incomplete local membership state
  • add debug logs for:
    • received Matrix events
    • require-mention drops
    • DM detection source (state_store_full vs joined_members)
  • harden the encrypted attachment unit test so it passes without a real mautrix install in the test environment

Tests

python -m pytest tests/gateway/test_matrix.py tests/gateway/test_matrix_mention.py tests/gateway/test_matrix_voice.py -q

## Changed files

- `gateway/platforms/matrix.py` (modified, +69/-9)
- `tests/gateway/test_matrix.py` (modified, +67/-5)
- `tests/gateway/test_matrix_mention.py` (modified, +55/-0)
RAW_BUFFERClick to expand / collapse

Bug Description

After updating to the latest version (post-merge of #10860), the Matrix bot successfully joins rooms but does not receive or process any messages on a completely fresh setup.

There are no inbound event logs in --debug mode, and the bot appears to remain connected but never reacts to messages. This happens even with encryption disabled.

Steps to Reproduce

Steps to Reproduce

  1. Set up a fresh Debian VM
  2. Create a brand new Matrix account (e.g. on matrix.org)
  3. Install and configure hermes-agent (latest version)
  4. Ensure MATRIX_ENCRYPTION=false
  5. Start the bot with --debug
  6. Invite the bot to a room → bot joins successfully
  7. Send a message in the room

Expected Behavior

Bot logs inbound events in debug output Bot processes messages and sends responses

Actual Behavior

No inbound message logs at all No response from the bot Sync loop appears to stall or disconnect after ~30 seconds Bot behaves as if no message handlers are active

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

Matrix

Operating System

Debian 13

Python Version

Python 3.13.5

Hermes Version

Hermes Agent v0.10.0 (2026.4.16)

Logs

2026-04-17 16:39:28,898 INFO gateway.platforms.matrix: Matrix: using access token for @REDACTED:matrix.org (device REDACTED) 2026-04-17 16:39:29,705 INFO gateway.platforms.matrix: Matrix: cross-signing verified via recovery key 2026-04-17 16:39:29,706 INFO gateway.platforms.matrix: Matrix: E2EE enabled (store: /home/hermes/.hermes/platforms/matrix/store/crypto.db, device_id=REDACTED) 2026-04-17 16:39:29,963 INFO gateway.platforms.matrix: Matrix: initial sync complete, joined 1 rooms 2026-04-17 16:39:30,033 INFO gateway.platforms.matrix: Matrix: invited to !REDACTED:matrix.org — joining 2026-04-17 16:39:30,172 INFO gateway.platforms.matrix: Matrix: joined !REDACTED:matrix.org 2026-04-17 16:44:34,219 INFO gateway.platforms.matrix: Matrix: disconnected hermes@debian:~/.hermes/logs$ WARNING mau.crypto: No one-time keys nor device keys got when trying to share keys WARNING mau.crypto: No one-time keys nor device keys got when trying to share keys

extent analysis

TL;DR

The issue might be related to encryption or key sharing, and checking the encryption settings and key management could provide a workaround.

Guidance

  • Verify that MATRIX_ENCRYPTION is correctly set to false and that the bot is not attempting to use encryption.
  • Check the logs for any errors related to key sharing or encryption, such as the WARNING mau.crypto messages.
  • Investigate the E2EE enabled log message, as it suggests that end-to-end encryption is enabled, which may be causing issues.
  • Review the hermes-agent configuration and ensure that it is correctly set up for a non-encrypted connection.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The issue may be related to a change in the hermes-agent version, and reviewing the release notes for version 0.10.0 may provide more information. Additionally, the WARNING mau.crypto messages suggest a potential issue with key sharing.

Recommendation

Apply workaround: temporarily disable encryption and key sharing to see if the issue persists, as the MATRIX_ENCRYPTION=false setting may not be taking effect as expected.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING