Skip to content

fix(gateway): respect config.yaml slack.enabled when SLACK_BOT_TOKEN env var is set#15689

Closed
haru398801 wants to merge 1 commit into
NousResearch:mainfrom
haru398801:main
Closed

fix(gateway): respect config.yaml slack.enabled when SLACK_BOT_TOKEN env var is set#15689
haru398801 wants to merge 1 commit into
NousResearch:mainfrom
haru398801:main

Conversation

@haru398801

Copy link
Copy Markdown
Contributor

Problem

Setting SLACK_BOT_TOKEN in the environment (e.g. .env) unconditionally enabled the Slack gateway adapter, overriding slack.enabled: false in config.yaml. This caused a spurious error on every gateway startup:

ERROR gateway.platforms.slack: [Slack] SLACK_APP_TOKEN not set

This happens because SLACK_BOT_TOKEN can be used for purposes other than the Hermes messaging gateway — for example, skills or cron jobs that send Slack notifications don't require Socket Mode and therefore don't need SLACK_APP_TOKEN.

Fix

Move enabled = True inside the if Platform.SLACK not in config.platforms block so that an explicit slack.enabled: false in config.yaml is respected. The token is still stored on the config object so skills can access it, but the gateway adapter is not activated.

Behavior change

Scenario Before After
SLACK_BOT_TOKEN set, no yaml config Slack enabled ✅ Slack enabled ✅
SLACK_BOT_TOKEN set, slack.enabled: true in yaml Slack enabled ✅ Slack enabled ✅
SLACK_BOT_TOKEN set, slack.enabled: false in yaml Slack enabled ❌ (bug) Slack disabled ✅

🤖 Generated with Claude Code

…env var is set

Previously, setting SLACK_BOT_TOKEN in .env would unconditionally enable
the Slack gateway adapter regardless of `slack.enabled: false` in config.yaml.
This caused spurious "SLACK_APP_TOKEN not set" errors when the token was
used only by skills (e.g. cron jobs that send Slack messages) rather than
for the Hermes messaging gateway.

Now, enabled: false in config.yaml is respected — the token is stored so
skills can still use it, but the gateway adapter is not activated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/slack Slack app adapter area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists labels Apr 25, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #16288 — your commit was cherry-picked onto current main with authorship rewritten to your GitHub noreply email (1703a09). Original commit used a local-dev hostname which would have broken release-notes attribution. Thanks for the clean 5-line fix and the clear behavior-matrix in the PR body.
#16288

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

Labels

area/config Config system, migrations, profiles comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/slack Slack app adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants