fix(gateway): honor gateway_restart_notification under top-level platform sections (#24644)#24663
Closed
0xsir0000 wants to merge 1 commit into
Closed
Conversation
…form sections (NousResearch#24644) PlatformConfig.gateway_restart_notification has been a no-op when set under the user-friendly top-level platform section (e.g. ``telegram:``) in config.yaml. The bridge loop in ``load_gateway_config`` (gateway/config.py:758) only forwarded a fixed allowlist of keys, and gateway_restart_notification wasn't on the list, so: 1. ``telegram.gateway_restart_notification: false`` never reached the platforms data dict. 2. ``PlatformConfig.from_dict()`` read ``False`` of the safe default (``True``) every time. 3. The suppression check at gateway/run.py:2767 always evaluated to truthy → shutdown/restart notifications were always sent. The issue's suggested fix (route the key through ``bridged``) is not quite right: ``extra.update(bridged)`` would land it in ``extra`` where ``PlatformConfig.from_dict()`` never looks. ``enabled`` already solves the same problem by writing directly to ``plat_data`` at the top level — mirror that path for gateway_restart_notification, and include it in the "should we materialise this platform at all" guard so the toggle works even when no other bridgeable keys are present. Tests cover false / explicit-true / unset (default-true) under top-level ``telegram:`` and ``discord:`` sections so future refactoring of the bridge loop trips a clear regression instead of silently re-breaking the toggle. Fixes NousResearch#24644
This was referenced May 13, 2026
Contributor
|
This is implemented on current main. Automated hermes-sweeper review found that the linked bug #24644 has already been fixed by a later main-branch commit.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PlatformConfig.gateway_restart_notificationhas been a no-op when set under the user-friendly top-level platform section (e.g.telegram:) inconfig.yaml. The bridge loop inload_gateway_config(gateway/config.py:758) only forwarded a fixed allowlist of keys, andgateway_restart_notificationwasn't on the list, so:telegram.gateway_restart_notification: falsenever reached the platforms data dict.PlatformConfig.from_dict()read the safe default (True) every time.gateway/run.py:2767always evaluated to truthy → shutdown/restart notifications were always sent.Fix
The issue's suggested fix (route the key through
bridged) is not quite right —extra.update(bridged)would land it inextra, wherePlatformConfig.from_dict()never looks (it readsdata.get(\"gateway_restart_notification\")from the top level, see gateway/config.py:313).enabledalready solves the same problem by writing directly toplat_dataat the top level. This PR mirrors that path:Including the key in the early-
continueguard matters: without it, sections that only setgateway_restart_notification(no other bridgeable keys, no explicitenabled) would fall through tocontinueand never even materialise an entry inplatforms_data.Test plan
test_bridges_gateway_restart_notification_from_telegram_section—telegram.gateway_restart_notification: falseround-trips toFalse(the reported case).test_bridges_gateway_restart_notification_true_explicit— explicittrueunderdiscord:also bridges (proves the bridge isn't accidentally swallowing values that match the default).test_gateway_restart_notification_defaults_true_when_unset— omitting the key keepsTrueso existing configs are unaffected.tests/gateway/test_config.pystill pass.Without the fix, the two assertions targeting
Platform.DISCORD/Platform.TELEGRAMfail withKeyErrorbecause the platform entry isn't even created (verified by reverting the fix locally).Fixes #24644