@@ -237,12 +237,22 @@ function ensureGatewayConfig(config, port) {
|
237 | 237 | }; |
238 | 238 | } |
239 | 239 | |
240 | | -function activateSmokePlugin(config, pluginId) { |
| 240 | +export function activateSmokePlugin(config, pluginId, channels = []) { |
241 | 241 | const allow = Array.isArray(config.plugins?.allow) |
242 | 242 | ? Array.from(new Set([...config.plugins.allow, pluginId].filter(isNonEmptyString))) |
243 | 243 | : undefined; |
| 244 | +const channelConfig = { ...(config.channels ?? {}) }; |
| 245 | +for (const channel of channels) { |
| 246 | +channelConfig[channel] = { |
| 247 | + ...(typeof channelConfig[channel] === "object" && channelConfig[channel] !== null |
| 248 | + ? channelConfig[channel] |
| 249 | + : {}), |
| 250 | +enabled: true, |
| 251 | +}; |
| 252 | +} |
244 | 253 | return { |
245 | 254 | ...config, |
| 255 | + ...(channels.length > 0 ? { channels: channelConfig } : {}), |
246 | 256 | plugins: { |
247 | 257 | ...config.plugins, |
248 | 258 | enabled: true, |
@@ -645,7 +655,10 @@ async function smokePlugin(pluginId, pluginDir, requiresConfig, pluginIndex, plu
|
645 | 655 | const plan = buildPluginPlan(manifest); |
646 | 656 | const port = |
647 | 657 | readPositiveInt(process.env.OPENCLAW_BUNDLED_PLUGIN_RUNTIME_PORT_BASE, 19000) + pluginIndex * 3; |
648 | | -const config = ensureGatewayConfig(activateSmokePlugin(readConfig(), pluginId), port); |
| 658 | +const config = ensureGatewayConfig( |
| 659 | +activateSmokePlugin(readConfig(), pluginId, plan.channels), |
| 660 | +port, |
| 661 | +); |
649 | 662 | if (plan.speechProviders[0]) { |
650 | 663 | const provider = plan.speechProviders[0]; |
651 | 664 | config.messages = { |
|