From a27ce85d8c0e8bc2d12a533288ed78ac2470bf03 Mon Sep 17 00:00:00 2001 From: kuangmi-bit Date: Thu, 9 Jul 2026 19:50:45 +0800 Subject: [PATCH] fix(gateway): respect explicit Feishu enabled:false in config.yaml (fixes #47804) _apply_env_overrides() unconditionally set Feishu enabled=True when FEISHU_APP_ID and FEISHU_APP_SECRET env vars were present, ignoring explicit 'enabled: false' in config.yaml. This broke multi-profile setups where a secondary profile inherits env vars from the default profile but must keep Feishu disabled. Fix mirrors the Slack platform pattern (L1596): check _enabled_explicit before force-enabling. _enabled_explicit is set by _merge_platform_map when 'enabled' appears in a top-level YAML entry or platforms. map entry. --- gateway/config.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gateway/config.py b/gateway/config.py index 8c467196e3b5..d6ca84690266 100644 --- a/gateway/config.py +++ b/gateway/config.py @@ -1856,8 +1856,15 @@ def _enable_from_env(platform: Platform) -> PlatformConfig: if feishu_app_id and feishu_app_secret: if Platform.FEISHU not in config.platforms: config.platforms[Platform.FEISHU] = PlatformConfig() - config.platforms[Platform.FEISHU].enabled = True - config.platforms[Platform.FEISHU].extra.update({ + # Respect explicit enabled: false in config.yaml — don't force-enable + # when the user intentionally disabled the platform (mirrors Slack at L1596). + # _enabled_explicit is set in _merge_platform_map when "enabled" appears in + # a top-level platform YAML entry or platforms. map entry. + feishu_config = config.platforms[Platform.FEISHU] + enabled_was_explicit = bool(feishu_config.extra.get("_enabled_explicit", False)) + if not feishu_config.enabled and not enabled_was_explicit: + feishu_config.enabled = True + feishu_config.extra.update({ "app_id": feishu_app_id, "app_secret": feishu_app_secret, "domain": getenv("FEISHU_DOMAIN", "feishu"),