fix: reuse plugin snapshot for auto enable · openclaw/openclaw@df20958
shakkernerd
·
2026-05-06
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,7 @@ import { collectConfiguredAgentHarnessRuntimes } from "../agents/harness-runtime
|
2 | 2 | import { normalizeProviderId } from "../agents/provider-id.js"; |
3 | 3 | import { listPotentialConfiguredChannelPresenceSignals } from "../channels/config-presence.js"; |
4 | 4 | import { getChatChannelMeta, normalizeChatChannelId } from "../channels/registry.js"; |
| 5 | +import { getCurrentPluginMetadataSnapshot } from "../plugins/current-plugin-metadata-snapshot.js"; |
5 | 6 | import { |
6 | 7 | type PluginManifestRecord, |
7 | 8 | type PluginManifestRegistry, |
@@ -886,14 +887,23 @@ export function resolvePluginAutoEnableManifestRegistry(params: {
|
886 | 887 | env: NodeJS.ProcessEnv; |
887 | 888 | manifestRegistry?: PluginManifestRegistry; |
888 | 889 | }): PluginManifestRegistry { |
| 890 | +if (params.manifestRegistry) { |
| 891 | +return params.manifestRegistry; |
| 892 | +} |
| 893 | +if (!configMayNeedPluginManifestRegistry(params.config, params.env)) { |
| 894 | +return EMPTY_PLUGIN_MANIFEST_REGISTRY; |
| 895 | +} |
| 896 | +const currentSnapshot = getCurrentPluginMetadataSnapshot({ |
| 897 | +config: params.config, |
| 898 | +env: params.env, |
| 899 | +allowWorkspaceScopedSnapshot: true, |
| 900 | +}); |
889 | 901 | return ( |
890 | | -params.manifestRegistry ?? |
891 | | -(configMayNeedPluginManifestRegistry(params.config, params.env) |
892 | | - ? loadPluginMetadataSnapshot({ |
893 | | -config: params.config, |
894 | | -env: params.env, |
895 | | -}).manifestRegistry |
896 | | - : EMPTY_PLUGIN_MANIFEST_REGISTRY) |
| 902 | +currentSnapshot?.manifestRegistry ?? |
| 903 | +loadPluginMetadataSnapshot({ |
| 904 | +config: params.config, |
| 905 | +env: params.env, |
| 906 | +}).manifestRegistry |
897 | 907 | ); |
898 | 908 | } |
899 | 909 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。