From a01e767b249b311cd50f891ca923bbf250e4b4c4 Mon Sep 17 00:00:00 2001 From: haru398801 <1930707+haru398801@users.noreply.github.com> Date: Sun, 26 Apr 2026 00:05:06 +0900 Subject: [PATCH] fix(gateway): respect config.yaml slack.enabled when SLACK_BOT_TOKEN env var is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- gateway/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gateway/config.py b/gateway/config.py index d402e70eb88..e585ec0413c 100644 --- a/gateway/config.py +++ b/gateway/config.py @@ -934,8 +934,12 @@ def _apply_env_overrides(config: GatewayConfig) -> None: slack_token = os.getenv("SLACK_BOT_TOKEN") if slack_token: if Platform.SLACK not in config.platforms: + # No yaml config for Slack — env-only setup, enable it config.platforms[Platform.SLACK] = PlatformConfig() - config.platforms[Platform.SLACK].enabled = True + config.platforms[Platform.SLACK].enabled = True + # If yaml config exists, respect its enabled flag (don't override + # explicit enabled: false). Token is still stored so skills that + # send Slack messages can use it without activating the gateway adapter. config.platforms[Platform.SLACK].token = slack_token slack_home = os.getenv("SLACK_HOME_CHANNEL") if slack_home and Platform.SLACK in config.platforms: