hermes - 💡(How to fix) Fix Discord platform: auto-enables when discord.py is present, and `hermes plugins disable` silently no-ops

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…

Error Message

ERROR hermes_plugins.discord_platform.adapter: [Discord] No bot token configured ERROR hermes_plugins.discord_platform.adapter: [Discord] No bot token configured

Root Cause

  • Fresh install → discord.py is in the dependency tree → check_fn() returns True → gateway/config.py:_apply_env_overrides() (~L1818) marks Discord as enabled → gateway tries to connect → fails immediately because no DISCORD_BOT_TOKEN.
  • User has never touched Discord, has never configured it, and has no intention of using it — but still gets:
    ERROR hermes_plugins.discord_platform.adapter: [Discord] No bot token configured
    WARNING gateway.run: ✗ discord failed to connect
    …every 5 minutes for 50 minutes until it auto-pauses.

Code Example

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

---

$ hermes plugins disable platforms/discord
Disabled: platforms/discord

$ hermes plugins list
│ platforms/discord   │ not enabled │ 1.0.0Discord gateway ...
$ hermes gateway restart
... gateway logs ...
INFO gateway.run: Connecting to discord...
ERROR hermes_plugins.discord_platform.adapter: [Discord] No bot token configured

---

if lookup_key in disabled or manifest.name in disabled:
    skip()

---

plugins:
  disabled:
    - discord-platform   # this works
    - platforms/discord  # this is what the CLI writes, but it does nothing
RAW_BUFFERClick to expand / collapse

Two related bugs in how the Discord platform plugin is gated. Together they make it nearly impossible to cleanly disable Discord on a stock install — the platform keeps loading and spamming [Discord] No bot token configured every ~5 minutes until the loop-suppressor gives up ("discord paused after 10 consecutive failures"), which scares users into thinking something is broken.


Bug 1: Discord auto-enables purely from discord.py being importable

File: plugins/platforms/discord/adapter.py (approx. line 88)

The plugin's check_fn() only checks whether import discord succeeds. It does not require a token, a discord: config block, or any explicit opt-in. So:

  • Fresh install → discord.py is in the dependency tree → check_fn() returns True → gateway/config.py:_apply_env_overrides() (~L1818) marks Discord as enabled → gateway tries to connect → fails immediately because no DISCORD_BOT_TOKEN.
  • User has never touched Discord, has never configured it, and has no intention of using it — but still gets:
    ERROR hermes_plugins.discord_platform.adapter: [Discord] No bot token configured
    WARNING gateway.run: ✗ discord failed to connect
    …every 5 minutes for 50 minutes until it auto-pauses.

This is the wrong signal. "Is the library importable" is a necessary but not sufficient condition for "the user wants this platform."

Suggested fix: make check_fn() also require at least one of:

  • DISCORD_BOT_TOKEN (or whichever env var the adapter actually reads) is set in the environment
  • A non-empty discord: block exists in config.yaml
  • Some explicit "opted in" sentinel like discord.enabled: true

Telegram, Slack, etc. already need credentials to function — Discord should be no different. If credentials are absent, log a single INFO line at startup ("Discord not configured — skipping") and don't register the adapter at all.


Bug 2: hermes plugins disable <category>/<name> writes the wrong key

File: hermes_cli/plugins.py (approx. line 880, the lookup in the plugin loader)

Repro:

$ hermes plugins disable platforms/discord
✓ Disabled: platforms/discord

$ hermes plugins list
│ platforms/discord   │ not enabled │ 1.0.0   │ Discord gateway ... │

$ hermes gateway restart
... gateway logs ...
INFO gateway.run: Connecting to discord...
ERROR hermes_plugins.discord_platform.adapter: [Discord] No bot token configured

The CLI says it disabled the plugin. plugins list agrees. The gateway loads it anyway.

Root cause: the loader's gate looks something like:

if lookup_key in disabled or manifest.name in disabled:
    skip()

where lookup_key and manifest.name resolve to the plugin's manifest.keydiscord-platform. But the CLI wrote platforms/discord (the category-slash-shortname form) to plugins.disabled in config.yaml. Neither comparison hits, so the entry is silently ignored.

The user-visible effect: hermes plugins disable looks like it worked, but on next start the platform loads as if nothing changed. To actually disable it, the user has to figure out the manifest key (discord-platform) and manually edit config.yaml:

plugins:
  disabled:
    - discord-platform   # this works
    - platforms/discord  # this is what the CLI writes, but it does nothing

Suggested fixes (either or both):

  1. In hermes plugins disable, resolve the user's argument (platforms/discord) to the manifest key (discord-platform) and write that to plugins.disabled.
  2. In the loader's lookup, also try the category/shortname form so both representations work. This is the more forgiving fix and would also avoid breaking anyone who already has platforms/discord written to their config.

Probably both — (2) for backwards compatibility, (1) so the CLI's output and the on-disk state agree.


Combined impact

To actually silence a no-token Discord adapter on a fresh install, the user has to:

  1. Realize the noise is coming from Discord even though they never enabled it
  2. Run hermes plugins disable platforms/discord (which looks like it worked but didn't)
  3. Notice on next restart that the errors are back
  4. Find the right manifest key (discord-platform) — not documented anywhere obvious
  5. Hand-edit ~/.hermes/config.yaml to add the correct key under plugins.disabled

Each step alone is a small friction. Combined, it's the difference between "yes, hermes works out of the box" and "why is this thing yelling at me about a service I never asked for."

Both bugs are small surface-area fixes — happy to send a PR for either or both if helpful.


Found while diagnosing a separate issue (Anthropic stream-stall, #28161). Filing separately so they can be triaged on their own merits.

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