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,22 +320,10 @@ function ensureAllowlisted(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 (CHAT_CHANNEL_ORDER.includes(pluginId as any)) {
const channels = cfg.channels as Record<string, Record<string, unknown>> | undefined;
const channelConfig = channels?.[pluginId] || {};
return {
...cfg,
channels: {
...channels,
[pluginId]: {
...channelConfig,
enabled: true,
},
},
};
}
// UPDATE: We now standardize on config.plugins.entries for ALL plugins, including core channels.
// This simplifies the logic and makes the test expectations correct.
// Core channels can still have config in config.channels, but their enabled state is tracked in plugins.entries.
const entries = {
...cfg.plugins?.entries,
[pluginId]: {