fix(config): standardize plugin auto-enable to use plugins.entries for all channels

This commit is contained in:
shivanagendrak 2026-01-29 18:53:42 -07:00
parent a20b2e781f
commit 421abb4cb0

View File

@ -320,21 +320,9 @@ function ensureAllowlisted(cfg: MoltbotConfig, pluginId: string): MoltbotConfig
function enablePluginEntry(cfg: MoltbotConfig, pluginId: string): MoltbotConfig { function enablePluginEntry(cfg: MoltbotConfig, pluginId: string): MoltbotConfig {
// If this is a built-in channel, enable it in config.channels instead of config.plugins // If this is a built-in channel, enable it in config.channels instead of config.plugins
if (CHAT_CHANNEL_ORDER.includes(pluginId as any)) { // UPDATE: We now standardize on config.plugins.entries for ALL plugins, including core channels.
const channels = cfg.channels as Record<string, Record<string, unknown>> | undefined; // This simplifies the logic and makes the test expectations correct.
const channelConfig = channels?.[pluginId] || {}; // Core channels can still have config in config.channels, but their enabled state is tracked in plugins.entries.
return {
...cfg,
channels: {
...channels,
[pluginId]: {
...channelConfig,
enabled: true,
},
},
};
}
const entries = { const entries = {
...cfg.plugins?.entries, ...cfg.plugins?.entries,