mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 22:30:19 +00:00
fix: preserve forced plugin activation context
This commit is contained in:
@@ -69,10 +69,12 @@ export function withActivatedPluginIds(params: {
|
||||
enabled: true,
|
||||
};
|
||||
}
|
||||
const forcePluginsEnabled = params.config?.plugins?.enabled === false;
|
||||
return {
|
||||
...params.config,
|
||||
plugins: {
|
||||
...params.config?.plugins,
|
||||
...(forcePluginsEnabled ? { enabled: true } : {}),
|
||||
...(allow.size > 0 ? { allow: [...allow] } : {}),
|
||||
entries,
|
||||
},
|
||||
|
||||
@@ -38,6 +38,7 @@ export function withBundledPluginEnablementCompat(params: {
|
||||
pluginIds: readonly string[];
|
||||
}): PluginLoadOptions["config"] {
|
||||
const existingEntries = params.config?.plugins?.entries ?? {};
|
||||
const forcePluginsEnabled = params.config?.plugins?.enabled === false;
|
||||
let changed = false;
|
||||
const nextEntries: Record<string, PluginEntryConfig> = { ...existingEntries };
|
||||
|
||||
@@ -50,13 +51,16 @@ export function withBundledPluginEnablementCompat(params: {
|
||||
}
|
||||
|
||||
if (!changed) {
|
||||
return params.config;
|
||||
if (!forcePluginsEnabled) {
|
||||
return params.config;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...params.config,
|
||||
plugins: {
|
||||
...params.config?.plugins,
|
||||
...(forcePluginsEnabled ? { enabled: true } : {}),
|
||||
entries: {
|
||||
...existingEntries,
|
||||
...nextEntries,
|
||||
|
||||
Reference in New Issue
Block a user