mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:30:43 +00:00
fix: reuse plugin snapshot for auto enable
This commit is contained in:
@@ -2,6 +2,7 @@ import { collectConfiguredAgentHarnessRuntimes } from "../agents/harness-runtime
|
||||
import { normalizeProviderId } from "../agents/provider-id.js";
|
||||
import { listPotentialConfiguredChannelPresenceSignals } from "../channels/config-presence.js";
|
||||
import { getChatChannelMeta, normalizeChatChannelId } from "../channels/registry.js";
|
||||
import { getCurrentPluginMetadataSnapshot } from "../plugins/current-plugin-metadata-snapshot.js";
|
||||
import {
|
||||
type PluginManifestRecord,
|
||||
type PluginManifestRegistry,
|
||||
@@ -886,14 +887,23 @@ export function resolvePluginAutoEnableManifestRegistry(params: {
|
||||
env: NodeJS.ProcessEnv;
|
||||
manifestRegistry?: PluginManifestRegistry;
|
||||
}): PluginManifestRegistry {
|
||||
if (params.manifestRegistry) {
|
||||
return params.manifestRegistry;
|
||||
}
|
||||
if (!configMayNeedPluginManifestRegistry(params.config, params.env)) {
|
||||
return EMPTY_PLUGIN_MANIFEST_REGISTRY;
|
||||
}
|
||||
const currentSnapshot = getCurrentPluginMetadataSnapshot({
|
||||
config: params.config,
|
||||
env: params.env,
|
||||
allowWorkspaceScopedSnapshot: true,
|
||||
});
|
||||
return (
|
||||
params.manifestRegistry ??
|
||||
(configMayNeedPluginManifestRegistry(params.config, params.env)
|
||||
? loadPluginMetadataSnapshot({
|
||||
config: params.config,
|
||||
env: params.env,
|
||||
}).manifestRegistry
|
||||
: EMPTY_PLUGIN_MANIFEST_REGISTRY)
|
||||
currentSnapshot?.manifestRegistry ??
|
||||
loadPluginMetadataSnapshot({
|
||||
config: params.config,
|
||||
env: params.env,
|
||||
}).manifestRegistry
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user