





















@@ -23,6 +23,21 @@ type GatewayPluginBootstrapLog = {
2323debug: (message: string) => void;
2424};
252526+function applyActivationSectionsToRuntimeConfig(params: {
27+runtimeConfig: OpenClawConfig;
28+activationConfig: OpenClawConfig;
29+}): OpenClawConfig {
30+return {
31+ ...params.runtimeConfig,
32+ ...(params.activationConfig.channels !== undefined
33+ ? { channels: params.activationConfig.channels }
34+ : {}),
35+ ...(params.activationConfig.plugins !== undefined
36+ ? { plugins: params.activationConfig.plugins }
37+ : {}),
38+};
39+}
40+2641async function prestageGatewayBundledRuntimeDeps(params: {
2742cfg: OpenClawConfig;
2843pluginIds: readonly string[];
@@ -92,10 +107,12 @@ async function prestageGatewayBundledRuntimeDeps(params: {
9210793108export async function prepareGatewayPluginBootstrap(params: {
94109cfgAtStart: OpenClawConfig;
110+activationSourceConfig?: OpenClawConfig;
95111startupRuntimeConfig: OpenClawConfig;
96112minimalTestGateway: boolean;
97113log: GatewayPluginBootstrapLog;
98114}) {
115+const activationSourceConfig = params.activationSourceConfig ?? params.cfgAtStart;
99116const startupMaintenanceConfig =
100117params.cfgAtStart.channels === undefined && params.startupRuntimeConfig.channels !== undefined
101118 ? {
@@ -130,10 +147,13 @@ export async function prepareGatewayPluginBootstrap(params: {
130147131148const gatewayPluginConfig = params.minimalTestGateway
132149 ? params.cfgAtStart
133- : applyPluginAutoEnable({
134-config: params.cfgAtStart,
135-env: process.env,
136-}).config;
150+ : applyActivationSectionsToRuntimeConfig({
151+runtimeConfig: params.cfgAtStart,
152+activationConfig: applyPluginAutoEnable({
153+config: activationSourceConfig,
154+env: process.env,
155+}).config,
156+});
137157const defaultAgentId = resolveDefaultAgentId(gatewayPluginConfig);
138158const defaultWorkspaceDir = resolveAgentWorkspaceDir(gatewayPluginConfig, defaultAgentId);
139159const pluginLookUpTable = params.minimalTestGateway
@@ -142,7 +162,7 @@ export async function prepareGatewayPluginBootstrap(params: {
142162config: gatewayPluginConfig,
143163workspaceDir: defaultWorkspaceDir,
144164env: process.env,
145-activationSourceConfig: params.cfgAtStart,
165+ activationSourceConfig,
146166});
147167const deferredConfiguredChannelPluginIds = [
148168 ...(pluginLookUpTable?.startup.configuredDeferredChannelPluginIds ?? []),
@@ -162,7 +182,7 @@ export async function prepareGatewayPluginBootstrap(params: {
162182});
163183({ pluginRegistry, gatewayMethods: baseGatewayMethods } = loadGatewayStartupPlugins({
164184cfg: gatewayPluginConfig,
165-activationSourceConfig: params.cfgAtStart,
185+ activationSourceConfig,
166186workspaceDir: defaultWorkspaceDir,
167187log: params.log,
168188coreGatewayMethodNames: baseMethods,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。