fix(gateway): refresh native command channels when their registry is replaced (#199743) Root cause: src/gateway/server-plugin-reload-channels.ts:88 `collectTargets` restarts channels only when command entries change identity or the channel's own plugin changed. A reload of an unrelated plugin keeps the other plugins' command entries by identity, so no channel restarts. The old registry is still retired, and Telegram, Discord and Slack keep dispatching through native command candidates captured from it at account start. Fixes #199612 Thanks @eliavb43 for the report and diagnosis, @jupiterkatz1989-coder for confirming it, and @555aaditya for the fix. ## What Problem This Solves Fixes: after a config hot reload of any plugin, every plugin slash command on Telegram answers "⚠️ This command is no longer available after the plugin registry changed. Please try again." until the Gateway restarts. Discord and Slack native commands bind the same way. ## User Impact User impact: plugin slash commands on native-command channels keep working after a plugin hot reload, including when the reloaded plugin is unrelated to the command. ## Why This Change Was Made Telegram (`bot-native-commands.ts:80`), Discord (`provider.commands.ts:34`) and Slack (`slash.ts:919`) take native command candidates from `createPluginCommandRuntime().listNativeCandidates()` when an account starts. Each candidate is bound to that registry generation, and a dispatch from a retired generation returns the refusal above (`plugin-command-runtime.ts:149`). A plugin reload publishes a new registry and retires the old one, but `collectTargets` did not refresh channels when the command list kept its identity. `collectTargets` now also targets channels with `capabilities.nativeCommands` that had a plugin command for that channel in the replaced registry. It uses the same `pluginCommandSupportsChannel` filter as `listNativeCandidates`. Those channels go through the existing reload stop, start and route-handoff path that command-list changes already use. Channels without native commands, or without plugin commands for that channel, keep running. Update behavior: Gateway runtime only. No persisted state, config or schema change. It takes effect when the updated Gateway starts; the installed updater is not involved. ## Evidence Live Telegram Test Server run (real QA user DM, TDLib records), built merge base `6341f93c9c` against this branch, same scenario: [proof comment](https://github.com/openclaw/openclaw/pull/199743#issuecomment-7028740443). - Base: `/p199612ping` answers `P199612_PONG`. After `plugins.entries.p199612-other.config.rev` changes (hot reload, no Telegram restart), it answers `⚠️ This command is no longer available after the plugin registry changed. Please try again.` - This branch: Telegram restarts with `reason: plugin-reload` during the same reload, and `/p199612ping` keeps answering `P199612_PONG`. - Control, same on both: disabling the plugin that owns `/p199612gone` removes the command. Its handler never runs, and the message goes to a normal agent turn. Regression in `server-plugin-reload.recovery.test.ts`: an unrelated plugin reloads while a sibling owns a native-command channel with a retained command and a channel without native commands. It fails on the merge base (`expected [ 'plain', 'native' ] to deeply equal [ 'plain', 'native', 'native' ]`). On this branch it passes: only the native channel restarts, and its new candidate runs the command. Merge danger: two-way door. A revert restores the old behavior, and nothing is persisted. Blast radius: on a plugin hot reload, channels with native commands and plugin commands (Telegram, Discord, Slack, Mattermost) now restart through the existing reload path. They already did this whenever the command list changed. Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Current
·
C2
·2026-11
fix(gateway): refresh native command channels when their registry is …
Find Your Interest
- fix: preserve foreground exec output (#202177)
- NDLEA arrests 34-year-old man with human hand in Taraba
- refactor(gateway): check forwarded node approvals once at sanitizatio…
- Osun police vow to prosecute mob behind killing after fatal crash
- Osun: Police arrest suspected cultists, recover arms
- FRSC urges motorists to avoid Lagos-Ibadan Expressway gridlock
- Police search for family of Canadian-Nigerian man killed in Lagos Airport Road accident
- 2027: Sokoto police order neutrality, stronger intelligence ahead of elections
- fix(auto-reply): a message sent after /stop is not answered when the …
- fix: wait for Git command cleanup before releasing custody (#201301)
Current
·
C2
·2026-11





