chore(gateway): drop plugin-migrated platforms from /update allowlist#40711
Merged
Conversation
`gateway/run.py::_UPDATE_ALLOWED_PLATFORMS` was a hardcoded frozenset listing every messaging platform allowed to invoke the `/update` slash command. Plugin-migrated platforms (currently Discord and Mattermost, soon also Home Assistant via #32500) declare `allow_update_command=True` on their `PlatformEntry`, and `_handle_update_command` already falls back to the registry when a platform isn't in the frozenset. The result was a silent redundancy: those entries said "allowed" twice, and the registry flag was a no-op for them in practice. - Removed `Platform.DISCORD` and `Platform.MATTERMOST` from the frozenset. - Updated the docstring to make the split explicit (built-ins live in the frozenset; plugins use `allow_update_command` on the registry entry). The remaining frozenset entries are all still built-in platforms living under `gateway/platforms/` today. Future plugin migrations should drop their entry from the frozenset as part of the migration PR (or in a sibling chore PR like this one). Added a `TestUpdateCommandPlatformGate` test class that pins down all three branches of the gate so future changes don't silently regress: - Programmatic interfaces (`Platform.WEBHOOK`, `Platform.API_SERVER`) must remain blocked. - Plugin-migrated platforms (Discord, Mattermost) must pass via the registry fallback. - Built-in platforms in the hardcoded frozenset (Telegram) must still pass without needing the registry. The gate previously had zero direct test coverage — its only existing coverage was `test_no_adapter_for_platform` which exercised a different code path.
Contributor
🔎 Lint report:
|
This was referenced Jun 6, 2026
teknium1
added a commit
that referenced
this pull request
Jun 7, 2026
Home Assistant is a bundled plugin now (#40709) and declares allow_update_command=True on its PlatformEntry. The registry fallback in _handle_update_command already covers it, so the frozenset entry is a redundant double-allow — same cleanup #40711 did for Discord and Mattermost. Adds a registry-fallback test mirroring the existing discord/mattermost cases.
changman
pushed a commit
to changman/hermes-agent
that referenced
this pull request
Jun 10, 2026
…ch#40736) Home Assistant is a bundled plugin now (NousResearch#40709) and declares allow_update_command=True on its PlatformEntry. The registry fallback in _handle_update_command already covers it, so the frozenset entry is a redundant double-allow — same cleanup NousResearch#40711 did for Discord and Mattermost. Adds a registry-fallback test mirroring the existing discord/mattermost cases.
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
Drops
Platform.DISCORDandPlatform.MATTERMOSTfrom the hardcoded_UPDATE_ALLOWED_PLATFORMSfrozenset ingateway/run.py. Both are bundled plugins now (Discord #24356, Mattermost #31748) and declareallow_update_command=Trueon theirPlatformEntry;_handle_update_commandalready falls back to the registry for platforms not in the frozenset. The double-allow becomes a single, load-bearing registry flag.Salvage of #32525 by @kshitijk4poor onto current
main(original branch was 1211 commits behind). Cherry-pick preserved authorship; cleanly re-verified.Changes
gateway/run.py: removePlatform.DISCORD+Platform.MATTERMOSTfrom_UPDATE_ALLOWED_PLATFORMS;Platform.HOMEASSISTANTretained (its migration is the sibling PR — drop it there)tests/gateway/test_update_command.py: +5 cases pinning every branch of the allowlist gate (programmatic interfaces blocked, plugin platforms pass via registry fallback, built-ins still pass via frozenset)Validation
allow_update_command=Truetest_update_command.py(+5 new gate-coverage cases)Original PR: #32525
Infographic