mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-12 08:51:53 +00:00
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.<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.
This commit is contained in:
parent
6d2727ef1c
commit
44f3e51865
2 changed files with 13 additions and 0 deletions
|
|
@ -916,6 +916,18 @@ def load_gateway_config() -> GatewayConfig:
|
||||||
if entry.apply_yaml_config_fn is None:
|
if entry.apply_yaml_config_fn is None:
|
||||||
continue
|
continue
|
||||||
platform_cfg = yaml_cfg.get(entry.name)
|
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):
|
if not isinstance(platform_cfg, dict):
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,7 @@ AUTHOR_MAP = {
|
||||||
"264291321+v1b3coder@users.noreply.github.com": "v1b3coder",
|
"264291321+v1b3coder@users.noreply.github.com": "v1b3coder",
|
||||||
"silverchris@foxmail.com": "ming1523",
|
"silverchris@foxmail.com": "ming1523",
|
||||||
"maksesipov@gmail.com": "Qwinty",
|
"maksesipov@gmail.com": "Qwinty",
|
||||||
|
"byquenox@gmail.com": "Que0x",
|
||||||
"denisamania@gmail.com": "CalmProton",
|
"denisamania@gmail.com": "CalmProton",
|
||||||
"308068+mbac@users.noreply.github.com": "mbac",
|
"308068+mbac@users.noreply.github.com": "mbac",
|
||||||
"nicoechaniz@altermundi.net": "nicoechaniz",
|
"nicoechaniz@altermundi.net": "nicoechaniz",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue