mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-05 22:32:12 +00:00
fix(config): tolerate missing facade boundary config
This commit is contained in:
@@ -115,10 +115,10 @@ function hasEnvConfiguredChannel(env: NodeJS.ProcessEnv): boolean {
|
||||
}
|
||||
|
||||
export function hasPotentialConfiguredChannels(
|
||||
cfg: OpenClawConfig,
|
||||
cfg: OpenClawConfig | null | undefined,
|
||||
env: NodeJS.ProcessEnv = process.env,
|
||||
): boolean {
|
||||
const channels = isRecord(cfg.channels) ? cfg.channels : null;
|
||||
const channels = isRecord(cfg?.channels) ? cfg.channels : null;
|
||||
if (channels) {
|
||||
for (const [key, value] of Object.entries(channels)) {
|
||||
if (IGNORED_CHANNEL_CONFIG_KEYS.has(key)) {
|
||||
|
||||
@@ -653,20 +653,21 @@ export function applyPluginAutoEnable(params: {
|
||||
manifestRegistry?: PluginManifestRegistry;
|
||||
}): PluginAutoEnableResult {
|
||||
const env = params.env ?? process.env;
|
||||
if (!configMayNeedPluginAutoEnable(params.config, env)) {
|
||||
return { config: params.config, changes: [], autoEnabledReasons: {} };
|
||||
const config = params.config ?? ({} as OpenClawConfig);
|
||||
if (!configMayNeedPluginAutoEnable(config, env)) {
|
||||
return { config, changes: [], autoEnabledReasons: {} };
|
||||
}
|
||||
const registry =
|
||||
params.manifestRegistry ??
|
||||
(configMayNeedPluginManifestRegistry(params.config)
|
||||
? loadPluginManifestRegistry({ config: params.config, env })
|
||||
(configMayNeedPluginManifestRegistry(config)
|
||||
? loadPluginManifestRegistry({ config, env })
|
||||
: EMPTY_PLUGIN_MANIFEST_REGISTRY);
|
||||
const configured = resolveConfiguredPlugins(params.config, env, registry);
|
||||
const configured = resolveConfiguredPlugins(config, env, registry);
|
||||
if (configured.length === 0) {
|
||||
return { config: params.config, changes: [], autoEnabledReasons: {} };
|
||||
return { config, changes: [], autoEnabledReasons: {} };
|
||||
}
|
||||
|
||||
let next = params.config;
|
||||
let next = config;
|
||||
const changes: string[] = [];
|
||||
const autoEnabledReasons = new Map<string, string[]>();
|
||||
|
||||
|
||||
@@ -155,8 +155,8 @@ function getFacadeBoundaryResolvedConfig() {
|
||||
const resolved = {
|
||||
rawConfig,
|
||||
config,
|
||||
normalizedPluginsConfig: normalizePluginsConfig(config.plugins),
|
||||
sourceNormalizedPluginsConfig: normalizePluginsConfig(rawConfig.plugins),
|
||||
normalizedPluginsConfig: normalizePluginsConfig(config?.plugins),
|
||||
sourceNormalizedPluginsConfig: normalizePluginsConfig(rawConfig?.plugins),
|
||||
autoEnabledReasons: autoEnabled.autoEnabledReasons,
|
||||
};
|
||||
cachedBoundaryRawConfig = rawConfig;
|
||||
|
||||
Reference in New Issue
Block a user