Skip to content

fix(gateway): derive channel directory platforms from enum instead of hardcoded list - #7450

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-17b93f0b
Apr 11, 2026
Merged

fix(gateway): derive channel directory platforms from enum instead of hardcoded list#7450
teknium1 merged 1 commit into
mainfrom
hermes/hermes-17b93f0b

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Six platforms (matrix, mattermost, dingtalk, feishu, wecom, homeassistant) were missing from the session-based discovery loop in gateway/channel_directory.py, causing /channels and send_message to return empty results on those platforms.

Instead of adding them to the hardcoded tuple (which would break again when new platforms are added), this derives the list dynamically from the Platform enum. Only infrastructure entries (local, api_server, webhook) are excluded. Discord and Slack are skipped automatically because their direct builders already populate the platforms dict before the loop runs.

Changes

  • gateway/channel_directory.py: Replace hardcoded 7-platform tuple with dynamic Platform enum iteration (+9/-4 lines)

Test results

  • 22 channel_directory tests pass
  • E2E verified: all 18 Platform enum values accounted for (13 session discovery + 2 direct builders + 3 infrastructure skip)

Salvaged from PR #7416 by @sprmn24 — upgraded from tuple expansion to dynamic enum derivation to prevent recurrence.

… hardcoded list

Six platforms (matrix, mattermost, dingtalk, feishu, wecom, homeassistant)
were missing from the session-based discovery loop, causing /channels and
send_message to return empty results on those platforms.

Instead of adding them to the hardcoded tuple (which would break again when
new platforms are added), derive the list dynamically from the Platform enum.
Only infrastructure entries (local, api_server, webhook) are excluded;
Discord and Slack are skipped automatically because their direct builders
already populate the platforms dict.

Reported by sprmn24 in PR #7416.
@teknium1
teknium1 merged commit baddb6f into main Apr 11, 2026
3 of 4 checks passed
Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
… hardcoded list (NousResearch#7450)

Six platforms (matrix, mattermost, dingtalk, feishu, wecom, homeassistant)
were missing from the session-based discovery loop, causing /channels and
send_message to return empty results on those platforms.

Instead of adding them to the hardcoded tuple (which would break again when
new platforms are added), derive the list dynamically from the Platform enum.
Only infrastructure entries (local, api_server, webhook) are excluded;
Discord and Slack are skipped automatically because their direct builders
already populate the platforms dict.

Reported by sprmn24 in PR NousResearch#7416.
luigileap added a commit to luigileap/hermes-agent that referenced this pull request Apr 16, 2026
PR NousResearch#7450 replaced the hardcoded session-discovery list in
`gateway.channel_directory.build_channel_directory`:

    for plat_name in ("telegram", "whatsapp", "signal", "weixin",
                       "email", "sms", "bluebubbles"):
        if plat_name not in platforms:
            platforms[plat_name] = _build_from_sessions(plat_name)

with a dynamic enumeration over the `Platform` enum that excludes only
infrastructure entries (`local`, `api_server`, `webhook`).  Six
platforms that had been missing from the old tuple are now discovered
automatically.

`test_email_in_session_discovery` was pinned to the old literal source
text and grepped for `"email"` inside the function body, so the
refactor broke it even though email is still routed through session
discovery.

Rewrite the test to assert actual behaviour: patch `_build_from_sessions`
and `atomic_json_write`, invoke `build_channel_directory({})`, and
verify that email is one of the platforms routed through session
discovery AND shows up as a top-level key in the returned directory.
Source-grep assertions are brittle against refactors like this one.
ciolansteen pushed a commit to ciolansteen/hermes-agent that referenced this pull request Apr 26, 2026
Re-applied on top of clean origin/main after iAdrian branch reset:

.gitea/workflows/:
- sync-from-github.yml — pulls main from GitHub fork into Gitea every 10min
- docker-build.yml     — builds + pushes hermes-agent image to git.ciolan.net
- tests.yml            — pytest on PR/push (mirrors GitHub tests.yml subset)
- nix.yml              — no-op override to prevent upstream nix CI on Gitea

.github/workflows/:
- sync-upstream.yml — pulls NousResearch/hermes-agent main into iAdrian fork every 10min

Replaces the 18 incremental CI commits from the old iAdrian history (all
squashed into this single clean commit). All upstream code-level patches
(matrix E2EE, Dockerfile-git, channel_directory) are obsolete: upstream
shipped equivalent or better fixes (PRs NousResearch#10860, NousResearch#7450), so iAdrian now
tracks main exactly minus this CI overlay.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
… hardcoded list (NousResearch#7450)

Six platforms (matrix, mattermost, dingtalk, feishu, wecom, homeassistant)
were missing from the session-based discovery loop, causing /channels and
send_message to return empty results on those platforms.

Instead of adding them to the hardcoded tuple (which would break again when
new platforms are added), derive the list dynamically from the Platform enum.
Only infrastructure entries (local, api_server, webhook) are excluded;
Discord and Slack are skipped automatically because their direct builders
already populate the platforms dict.

Reported by sprmn24 in PR NousResearch#7416.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
… hardcoded list (NousResearch#7450)

Six platforms (matrix, mattermost, dingtalk, feishu, wecom, homeassistant)
were missing from the session-based discovery loop, causing /channels and
send_message to return empty results on those platforms.

Instead of adding them to the hardcoded tuple (which would break again when
new platforms are added), derive the list dynamically from the Platform enum.
Only infrastructure entries (local, api_server, webhook) are excluded;
Discord and Slack are skipped automatically because their direct builders
already populate the platforms dict.

Reported by sprmn24 in PR NousResearch#7416.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
… hardcoded list (NousResearch#7450)

Six platforms (matrix, mattermost, dingtalk, feishu, wecom, homeassistant)
were missing from the session-based discovery loop, causing /channels and
send_message to return empty results on those platforms.

Instead of adding them to the hardcoded tuple (which would break again when
new platforms are added), derive the list dynamically from the Platform enum.
Only infrastructure entries (local, api_server, webhook) are excluded;
Discord and Slack are skipped automatically because their direct builders
already populate the platforms dict.

Reported by sprmn24 in PR NousResearch#7416.
skappafrost pushed a commit to skappafrost/hermes-agent that referenced this pull request Aug 15, 2026
… hardcoded list (NousResearch#7450)

Six platforms (matrix, mattermost, dingtalk, feishu, wecom, homeassistant)
were missing from the session-based discovery loop, causing /channels and
send_message to return empty results on those platforms.

Instead of adding them to the hardcoded tuple (which would break again when
new platforms are added), derive the list dynamically from the Platform enum.
Only infrastructure entries (local, api_server, webhook) are excluded;
Discord and Slack are skipped automatically because their direct builders
already populate the platforms dict.

Reported by sprmn24 in PR NousResearch#7416.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant