mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 11:21:07 +00:00
Gateway: keep auto-enabled plugin config through startup
This commit is contained in:
@@ -551,12 +551,16 @@ export async function startGatewayServer(
|
||||
}
|
||||
|
||||
initSubagentRegistry();
|
||||
const defaultAgentId = resolveDefaultAgentId(cfgAtStart);
|
||||
const defaultWorkspaceDir = resolveAgentWorkspaceDir(cfgAtStart, defaultAgentId);
|
||||
const gatewayPluginConfigAtStart = applyPluginAutoEnable({
|
||||
config: cfgAtStart,
|
||||
env: process.env,
|
||||
}).config;
|
||||
const defaultAgentId = resolveDefaultAgentId(gatewayPluginConfigAtStart);
|
||||
const defaultWorkspaceDir = resolveAgentWorkspaceDir(gatewayPluginConfigAtStart, defaultAgentId);
|
||||
const deferredConfiguredChannelPluginIds = minimalTestGateway
|
||||
? []
|
||||
: resolveConfiguredDeferredChannelPluginIds({
|
||||
config: cfgAtStart,
|
||||
config: gatewayPluginConfigAtStart,
|
||||
workspaceDir: defaultWorkspaceDir,
|
||||
env: process.env,
|
||||
});
|
||||
@@ -566,7 +570,7 @@ export async function startGatewayServer(
|
||||
let baseGatewayMethods = baseMethods;
|
||||
if (!minimalTestGateway) {
|
||||
({ pluginRegistry, gatewayMethods: baseGatewayMethods } = loadGatewayStartupPlugins({
|
||||
cfg: cfgAtStart,
|
||||
cfg: gatewayPluginConfigAtStart,
|
||||
workspaceDir: defaultWorkspaceDir,
|
||||
log,
|
||||
coreGatewayHandlers,
|
||||
@@ -671,7 +675,11 @@ export async function startGatewayServer(
|
||||
}
|
||||
const serverStartedAt = Date.now();
|
||||
const channelManager = createChannelManager({
|
||||
loadConfig,
|
||||
loadConfig: () =>
|
||||
applyPluginAutoEnable({
|
||||
config: loadConfig(),
|
||||
env: process.env,
|
||||
}).config,
|
||||
channelLogs,
|
||||
channelRuntimeEnvs,
|
||||
resolveChannelRuntime: getChannelRuntime,
|
||||
@@ -1317,7 +1325,7 @@ export async function startGatewayServer(
|
||||
if (!minimalTestGateway) {
|
||||
if (deferredConfiguredChannelPluginIds.length > 0) {
|
||||
({ pluginRegistry } = reloadDeferredGatewayPlugins({
|
||||
cfg: cfgAtStart,
|
||||
cfg: gatewayPluginConfigAtStart,
|
||||
workspaceDir: defaultWorkspaceDir,
|
||||
log,
|
||||
coreGatewayHandlers,
|
||||
@@ -1326,7 +1334,7 @@ export async function startGatewayServer(
|
||||
}));
|
||||
}
|
||||
({ pluginServices } = await startGatewaySidecars({
|
||||
cfg: cfgAtStart,
|
||||
cfg: gatewayPluginConfigAtStart,
|
||||
pluginRegistry,
|
||||
defaultWorkspaceDir,
|
||||
deps,
|
||||
|
||||
Reference in New Issue
Block a user