
























@@ -37,7 +37,11 @@ import {
3737resolveBundledRuntimeDependencyInstallRoot,
3838type BundledRuntimeDepsInstallParams,
3939} from "./bundled-runtime-deps.js";
40-import { clearPluginCommands } from "./command-registry-state.js";
40+import {
41+clearPluginCommands,
42+listRegisteredPluginCommands,
43+restorePluginCommands,
44+} from "./command-registry-state.js";
4145import {
4246clearCompactionProviders,
4347listRegisteredCompactionProviders,
@@ -56,7 +60,11 @@ import {
5660} from "./config-state.js";
5761import { discoverOpenClawPlugins } from "./discovery.js";
5862import { initializeGlobalHookRunner } from "./hook-runner-global.js";
59-import { clearPluginInteractiveHandlers } from "./interactive-registry.js";
63+import {
64+clearPluginInteractiveHandlers,
65+listPluginInteractiveHandlers,
66+restorePluginInteractiveHandlers,
67+} from "./interactive-registry.js";
6068import { getCachedPluginJitiLoader, type PluginJitiLoaderCache } from "./jiti-loader-cache.js";
6169import { loadPluginManifestRegistry } from "./manifest-registry.js";
6270import type { PluginBundleFormat, PluginDiagnostic, PluginFormat } from "./manifest-types.js";
@@ -205,6 +213,8 @@ export class PluginLoadReentryError extends Error {
205213type CachedPluginState = {
206214registry: PluginRegistry;
207215detachedTaskRuntimeRegistration: ReturnType<typeof getDetachedTaskLifecycleRuntimeRegistration>;
216+commands: ReturnType<typeof listRegisteredPluginCommands>;
217+interactiveHandlers: ReturnType<typeof listPluginInteractiveHandlers>;
208218memoryCapability: ReturnType<typeof getMemoryCapabilityRegistration>;
209219memoryCorpusSupplements: ReturnType<typeof listMemoryCorpusSupplements>;
210220agentHarnesses: ReturnType<typeof listRegisteredAgentHarnesses>;
@@ -243,8 +253,10 @@ export function clearPluginLoaderCache(): void {
243253openAllowlistWarningCache.clear();
244254clearBundledRuntimeDependencyNodePaths();
245255clearAgentHarnesses();
256+clearPluginCommands();
246257clearCompactionProviders();
247258clearDetachedTaskLifecycleRuntimeRegistration();
259+clearPluginInteractiveHandlers();
248260clearMemoryEmbeddingProviders();
249261clearMemoryPluginState();
250262}
@@ -1871,8 +1883,10 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
18711883const cached = getCachedPluginRegistry(cacheKey);
18721884if (cached) {
18731885restoreRegisteredAgentHarnesses(cached.agentHarnesses);
1886+restorePluginCommands(cached.commands);
18741887restoreRegisteredCompactionProviders(cached.compactionProviders);
18751888restoreDetachedTaskLifecycleRuntimeRegistration(cached.detachedTaskRuntimeRegistration);
1889+restorePluginInteractiveHandlers(cached.interactiveHandlers);
18761890restoreRegisteredMemoryEmbeddingProviders(cached.memoryEmbeddingProviders);
18771891restoreMemoryPluginState({
18781892capability: cached.memoryCapability,
@@ -2825,7 +2839,9 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
2825283928262840if (cacheEnabled) {
28272841setCachedPluginRegistry(cacheKey, {
2842+commands: listRegisteredPluginCommands(),
28282843detachedTaskRuntimeRegistration: getDetachedTaskLifecycleRuntimeRegistration(),
2844+interactiveHandlers: listPluginInteractiveHandlers(),
28292845memoryCapability: getMemoryCapabilityRegistration(),
28302846memoryCorpusSupplements: listMemoryCorpusSupplements(),
28312847 registry,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。