Skip to content

fix(gateway): load nested platform config + bridge Discord allow_from - #35329

Merged
teknium1 merged 3 commits into
mainfrom
hermes/hermes-1d2bf0ef
May 30, 2026
Merged

fix(gateway): load nested platform config + bridge Discord allow_from#35329
teknium1 merged 3 commits into
mainfrom
hermes/hermes-1d2bf0ef

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Gateway config defined under documented-but-unwired paths now actually takes effect: nested gateway.platforms.<name> blocks load, and Discord allow_from reaches the env var the adapter enforces auth from. Combines two que0x (@Que0x) fixes that both touched gateway/config.py and would have conflicted if merged separately.

Changes

  • gateway/config.py: generalize the existing gateway.streaming nested-fallback pattern to platforms — merge gateway.platforms.<name> into the platform map (top-level platforms: keeps precedence). (fix(gateway): load nested gateway.platforms config #34565)
  • plugins/platforms/discord/adapter.py + gateway/config.py: bridge discord.allow_from and platforms.discord.extra.allow_from to DISCORD_ALLOWED_USERS, env-overrides-first. (Fix Discord allow_from config bridge for gateway auth #34557)
  • gateway/config.py: follow-up — run plugin apply_yaml_config_fn hooks even when a platform is configured only under a nested block (no top-level discord:), so the platforms.discord.extra.allow_from path actually fires.
  • scripts/release.py: map byquenox@gmail.com -> Que0x.

Root cause

load_gateway_config() only merged top-level platforms:, and the adapter-hook dispatch loop only ran for top-level blocks. Both left documented config paths silently inert.

Validation

Path Before After
gateway.platforms.telegram.* dropped loaded
discord.allow_from -> DISCORD_ALLOWED_USERS not bridged bridged
platforms.discord.extra.allow_from -> env not bridged bridged
top-level platforms: vs gateway.platforms: n/a top-level wins
  • tests/gateway/test_config.py + discord auth/control suites: 107 passed
  • E2E with isolated HERMES_HOME across all four config shapes: env var + platform config resolve correctly

Salvages #34557 and #34565 (both @Que0x), contributor commits preserved.

Infographic

gateway-config-footguns-fixed

Que0x and others added 3 commits May 30, 2026 05:07
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.<name>` or `gateway.platforms.<name>` 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.
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-1d2bf0ef vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9507 on HEAD, 9507 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4931 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@teknium1
teknium1 merged commit 44f3e51 into main May 30, 2026
23 checks passed
@teknium1
teknium1 deleted the hermes/hermes-1d2bf0ef branch May 30, 2026 12:23
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/discord Discord bot adapter area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists labels May 30, 2026
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/discord Discord bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants