Skip to content

fix(channels): registry-loader fallback to unstable getActivePluginRegistry() causes 'Outbound not configured' for Discord #84568

@chouzz

Description

@chouzz

Bug Summary

After upgrading to 2026.5.19-beta.2, Discord bots can receive messages (inbound works, reactions added) but fail to reply (outbound delivery) with:

Outbound not configured for channel: discord

Root Cause

Commit d7896ed4c9 (ci: retry release artifact downloads, 2026-05-20) rewrote src/channels/plugins/registry-loader.ts and re-introduced a fallback to getActivePluginRegistry() — the unstable active registry that gets replaced every time loadOpenClawPlugins() runs (config schema reads, plugin status queries, tool list loads, cron jobs, health-monitor checks, etc.).

The buggy code in beta.2 compiled output (load-yRKrJeVQ.js):

const channelRegistry = getActivePluginChannelRegistry();  // pinned (stable)
const channelValue = resolveFromRegistry(channelRegistry);
if (channelValue !== void 0) return channelValue;

// ↓ THIS IS THE BUG — fallback to unstable registry
const activeRegistry = getActivePluginRegistry();
if (activeRegistry && activeRegistry !== channelRegistry)
    return resolveFromRegistry(activeRegistry);

The problem chain:

  1. getActivePluginChannelRegistry() internally does state.channel.registry ?? state.activeRegistry — if the pinned registry is null (not pinned yet, or released), it already returns the unstable one
  2. Even if pinned is set, the unstable getActivePluginRegistry() fallback can return a registry that was replaced mid-flight — one that lacks Discord's outbound adapter entry or only has it in "setup mode"
  3. Both lookups return undefinedOutbound not configured for channel: discord

Historical context

This was already fixed in commit bc9c074b2c (2026-03-26, fix(channels): use pinned channel registry for outbound adapter resolution), which removed the getActivePluginRegistry() fallback entirely. That commit was a correct fix. The release commit d7896ed4c9 silently reverted this fix.

Local Verification

I have verified the fix locally by patching the compiled load-yRKrJeVQ.js in the npm-installed 2026.5.19-beta.2 package:

Patch: Remove the getActivePluginRegistry import and fallback, only use getActivePluginChannelRegistry:

-import { a as getActivePluginRegistry, t as getActivePluginChannelRegistry } from "./runtime-OTX8N6Lz.js";
+import { t as getActivePluginChannelRegistry } from "./runtime-OTX8N6Lz.js";

 function createChannelRegistryLoader(resolveValue) {
   return async (id) => {
     const registry = getActivePluginChannelRegistry();
     const pluginEntry = registry?.channels.find(p => p.channelId === id);
     if (!pluginEntry) return void 0;
-    const activeRegistry = getActivePluginRegistry();
-    if (activeRegistry && activeRegistry !== registry) {
-      const activeEntry = activeRegistry?.channels.find(p => p.channelId === id);
-      if (activeEntry) return resolveValue(activeEntry);
-    }
     return resolveValue(pluginEntry);
   };
 }

Result: After patching + gateway restart, all 5 Discord bots (assistant, coder, default, researcher, writer) successfully receive AND reply to messages. No Outbound not configured errors.

Reproduction

  1. Install openclaw@2026.5.19-beta.2
  2. Configure Discord channel with multiple bot accounts
  3. Start gateway, wait for plugins to fully load
  4. Wait for any background operation to trigger loadOpenClawPlugins() (cron job, health-monitor, tool list refresh)
  5. Send a Discord message → bot adds reaction (inbound works) but does not reply (outbound fails)

Environment

  • OpenClaw: 2026.5.19-beta.2 (947a070)
  • Node: 24.14.1
  • OS: Linux 6.8.0-106-generic
  • 5 Discord bot accounts configured

Suggested Fix

Revert the fallback in src/channels/plugins/registry-loader.ts — only use getActivePluginChannelRegistry() (pinned), same as commit bc9c074b2c did. The unstable getActivePluginRegistry() should never be used for outbound adapter resolution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions