hermes - 💡(How to fix) Fix hermes plugins disable platforms/discord and platforms.discord.enabled: false ignored by _apply_env_overrides() plugin auto-enable loop

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…

A plugin disabled via hermes plugins disable <name> is still force-enabled at gateway startup by the plugin auto-enable loop in _apply_env_overrides(). The disable command updates plugins.disabled in config.yaml as expected, but platform_registry.plugin_entries() does not consult that list. Any plugin whose check_fn() returns True is then enabled = True-set unconditionally, overriding the user's config.

Error Message

ERROR hermes_plugins.discord_platform.adapter: [Discord] No bot token configured WARN gateway.run: ✗ discord failed to connect

Root Cause

A plugin disabled via hermes plugins disable <name> is still force-enabled at gateway startup by the plugin auto-enable loop in _apply_env_overrides(). The disable command updates plugins.disabled in config.yaml as expected, but platform_registry.plugin_entries() does not consult that list. Any plugin whose check_fn() returns True is then enabled = True-set unconditionally, overriding the user's config.

Fix Action

Fix / Workaround

Workarounds attempted (all fail)

The only working "workarounds" are: uninstall discord.py from the venv (next lazy-install re-creates it) or rename plugins/platforms/discord/plugin.yaml (setup-hermes.sh overwrites it).

Code Example

INFO  gateway.run: Connecting to discord...
ERROR hermes_plugins.discord_platform.adapter: [Discord] No bot token configured
WARN  gateway.run: ✗ discord failed to connect
INFO  gateway.run: Starting reconnection watcher for 1 failed platform(s): discord

---

platform = Platform(entry.name)
if platform not in config.platforms:
    config.platforms[platform] = PlatformConfig()
config.platforms[platform].enabled = True   # ← force-set, no disable check
RAW_BUFFERClick to expand / collapse

Summary

A plugin disabled via hermes plugins disable <name> is still force-enabled at gateway startup by the plugin auto-enable loop in _apply_env_overrides(). The disable command updates plugins.disabled in config.yaml as expected, but platform_registry.plugin_entries() does not consult that list. Any plugin whose check_fn() returns True is then enabled = True-set unconditionally, overriding the user's config.

Environment

  • Hermes upstream main at e97a4c8f3 (tag v2026.5.16 + 1 commit)
  • macOS 25.5.0 (Darwin)
  • Python 3.11.13 venv via uv

Repro

  1. Fresh install, no DISCORD_BOT_TOKEN env var, only Telegram + api_server in config.yaml platforms:.
  2. hermes plugins disable platforms/discord → succeeds, adds plugins.disabled: [platforms/discord] to config.yaml.
  3. (Optional, also tried) Add platforms.discord.enabled: false to config.yaml.
  4. Restart gateway.

Expected: Discord adapter not initialized, no connect attempts, no reconnect loop.

Actual: Gateway logs:

INFO  gateway.run: Connecting to discord...
ERROR hermes_plugins.discord_platform.adapter: [Discord] No bot token configured
WARN  gateway.run: ✗ discord failed to connect
INFO  gateway.run: Starting reconnection watcher for 1 failed platform(s): discord

…and retries every 60–300s indefinitely.

Trace

gateway/config.py load_gateway_config()GatewayConfig.from_dict() correctly produces config.platforms[Platform.DISCORD].enabled = False (verified by stepping the data going into from_dict).

Then _apply_env_overrides(config) at line ~1145 iterates platform_registry.plugin_entries(). At line ~1828:

platform = Platform(entry.name)
if platform not in config.platforms:
    config.platforms[platform] = PlatformConfig()
config.platforms[platform].enabled = True   # ← force-set, no disable check

For Discord, entry.check_fn() returns True (the bundled plugin's deps were lazy-installed). For other plugin platforms (google_chat, irc, line, simplex, teams) the deps aren't installed so check_fn returns False and they're correctly skipped — making Discord the only one that bites.

_get_disabled_plugins() in hermes_cli/plugins.py:180 reads plugins.disabled from config.yaml correctly; the disabled set IS available during plugin discovery. But the platform_registry registration happens earlier in the load process and _apply_env_overrides does not consult it.

Suggested fix

Either:

  • Filter platform_registry.plugin_entries() against _get_disabled_plugins() before the force-enable loop in _apply_env_overrides(), or
  • Skip the force-enable when config.platforms[platform].enabled was explicitly set to False in user config (currently the loop has no way to distinguish "user said no" from "user didn't say anything").

Happy to send a PR if a maintainer can confirm which fix shape is preferred.

Workarounds attempted (all fail)

  • hermes plugins disable platforms/discord — no effect on connect attempts
  • platforms.discord.enabled: false in config.yaml — no effect
  • Removing DISCORD_BOT_TOKEN — already absent

The only working "workarounds" are: uninstall discord.py from the venv (next lazy-install re-creates it) or rename plugins/platforms/discord/plugin.yaml (setup-hermes.sh overwrites it).

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

hermes - 💡(How to fix) Fix hermes plugins disable platforms/discord and platforms.discord.enabled: false ignored by _apply_env_overrides() plugin auto-enable loop