Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion gateway/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ def load_gateway_config() -> GatewayConfig:
plat_data, extra = _ensure_platform_extra_dict(platforms_data, plat.value)
if enabled_was_explicit:
plat_data["enabled"] = platform_cfg["enabled"]
if plat == Platform.SLACK and enabled_was_explicit:
if enabled_was_explicit:
extra["_enabled_explicit"] = True
extra.update(bridged)

Expand Down Expand Up @@ -1823,6 +1823,18 @@ def _apply_env_overrides(config: GatewayConfig) -> None:
continue
platform = Platform(entry.name)
existing_cfg = config.platforms.get(platform)
if (
existing_cfg is not None
and existing_cfg.extra.get("_enabled_explicit")
and not existing_cfg.enabled
):
# Respect explicit config.yaml `enabled: false` for plugin-owned
# platforms. Without this guard, the registry pass can
# re-enable an intentionally disabled platform just because its
# plugin dependency check succeeds (for example Discord with no
# bot token configured), causing pointless gateway retries.
existing_cfg.extra.pop("_enabled_explicit", None)
continue
# Seed candidate extras from ``env_enablement_fn`` so plugins
# whose ``is_connected`` reads ``config.extra`` (e.g. Google
# Chat's ``_is_connected`` checks ``config.extra["project_id"]``)
Expand Down