Skip to content

fix(gateway): honor MATRIX_HOME_ROOM in onboarding - #12698

Closed
mikeyobrien wants to merge 1 commit into
NousResearch:mainfrom
mikeyobrien:fix/matrix-home-room-onboarding
Closed

fix(gateway): honor MATRIX_HOME_ROOM in onboarding#12698
mikeyobrien wants to merge 1 commit into
NousResearch:mainfrom
mikeyobrien:fix/matrix-home-room-onboarding

Conversation

@mikeyobrien

@mikeyobrien mikeyobrien commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Bug Description

Matrix home delivery is configured with MATRIX_HOME_ROOM, but Hermes could still warn that no Matrix home target was set. The warning path and /sethome were not using the same home-target env-var mapping, so Matrix looked misconfigured even when it was correct.

Fixes N/A

Root Cause

gateway/run.py still had logic that assumed MATRIX_HOME_CHANNEL in the onboarding warning path, while Matrix actually uses MATRIX_HOME_ROOM. /sethome and onboarding were not grounded on the same shared mapping.

Fix

  • use the shared home-target env-var mapping in gateway onboarding warnings
  • make /sethome use the same mapping instead of assuming *_HOME_CHANNEL
  • add regression coverage for Matrix and fallback behavior

How to Verify

  1. Configure Matrix home delivery with MATRIX_HOME_ROOM.
  2. Start the gateway and confirm Hermes does not emit the false "No home channel is set for Matrix" warning.
  3. Run /sethome for Matrix and confirm the command resolves the same env-var mapping as onboarding.
  4. Run the regression tests below.

Test Plan

  • Added regression test for this bug
  • Existing tests still pass
  • Manual verification of the fix

Commands run:

  • PYTEST_ADDOPTS= pytest -q tests/gateway/test_home_target_env_var.py tests/gateway/test_steer_command.py tests/gateway/test_unauthorized_dm_behavior.py
  • PYTEST_ADDOPTS= pytest -q tests/gateway/test_home_target_env_var.py tests/gateway/test_matrix.py tests/cron/test_scheduler.py

Risk Assessment

Low — the change narrows behavior onto the existing shared home-target mapping and adds regression coverage around Matrix and fallback resolution.

@mikeyobrien
mikeyobrien marked this pull request as ready for review April 19, 2026 21:46
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/matrix Matrix adapter (E2EE) comp/gateway Gateway runner, session dispatch, delivery labels Apr 23, 2026
@teknium1

teknium1 commented May 1, 2026

Copy link
Copy Markdown
Contributor

Thanks @mikeyobrien — merged as PR #18272. Your fix was the right approach: single source of truth via _HOME_TARGET_ENV_VARS so /sethome and onboarding agree on the env-var name. Your commit was cherry-picked with authorship preserved (commit 1be3b74 on main), and the regression test was widened to also cover email (EMAIL_HOME_ADDRESS) and the convention platforms.

#18272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/matrix Matrix adapter (E2EE) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants