From 44f3e5186502167e68b6073b4f7bdfae7bfb4fbe Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sat, 30 May 2026 05:09:07 -0700 Subject: [PATCH] fix(gateway): run adapter config hooks for nested-only platform blocks The plugin apply_yaml_config_fn dispatch loop only ran when a top-level platform block (e.g. `discord:`) existed. Configs that defined a platform only under `platforms.` or `gateway.platforms.` skipped the hook, so `platforms.discord.extra.allow_from` never reached DISCORD_ALLOWED_USERS. Fall back to those nested blocks when the top-level one is absent. Also map byquenox@gmail.com -> Que0x for the salvaged commits. --- gateway/config.py | 12 ++++++++++++ scripts/release.py | 1 + 2 files changed, 13 insertions(+) diff --git a/gateway/config.py b/gateway/config.py index 83b9b912f..abc40d85c 100644 --- a/gateway/config.py +++ b/gateway/config.py @@ -916,6 +916,18 @@ def load_gateway_config() -> GatewayConfig: if entry.apply_yaml_config_fn is None: continue platform_cfg = yaml_cfg.get(entry.name) + # Fall back to the platform's block under ``platforms`` / + # ``gateway.platforms`` so adapter hooks still run when the + # user configured the platform only under those nested paths + # (e.g. ``platforms.discord.extra.allow_from``) and not via a + # top-level ``discord:`` block. + if not isinstance(platform_cfg, dict): + for _src in (gateway_platforms, yaml_cfg.get("platforms")): + if isinstance(_src, dict): + _candidate = _src.get(entry.name) + if isinstance(_candidate, dict): + platform_cfg = _candidate + break if not isinstance(platform_cfg, dict): continue try: diff --git a/scripts/release.py b/scripts/release.py index 11a446a50..39f60a4b8 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -223,6 +223,7 @@ AUTHOR_MAP = { "264291321+v1b3coder@users.noreply.github.com": "v1b3coder", "silverchris@foxmail.com": "ming1523", "maksesipov@gmail.com": "Qwinty", + "byquenox@gmail.com": "Que0x", "denisamania@gmail.com": "CalmProton", "308068+mbac@users.noreply.github.com": "mbac", "nicoechaniz@altermundi.net": "nicoechaniz",