mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 02:40:24 +00:00
refactor: centralize delivery/path/media/version lifecycle
This commit is contained in:
@@ -365,6 +365,11 @@ function warnAboutUntrackedLoadedPlugins(params: {
|
||||
}
|
||||
}
|
||||
|
||||
function activatePluginRegistry(registry: PluginRegistry, cacheKey: string): void {
|
||||
setActivePluginRegistry(registry, cacheKey);
|
||||
initializeGlobalHookRunner(registry);
|
||||
}
|
||||
|
||||
export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegistry {
|
||||
// Test env: default-disable plugins unless explicitly configured.
|
||||
// This keeps unit/gateway suites fast and avoids loading heavyweight plugin deps by accident.
|
||||
@@ -380,7 +385,7 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
|
||||
if (cacheEnabled) {
|
||||
const cached = registryCache.get(cacheKey);
|
||||
if (cached) {
|
||||
setActivePluginRegistry(cached, cacheKey);
|
||||
activatePluginRegistry(cached, cacheKey);
|
||||
return cached;
|
||||
}
|
||||
}
|
||||
@@ -711,8 +716,7 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
|
||||
if (cacheEnabled) {
|
||||
registryCache.set(cacheKey, registry);
|
||||
}
|
||||
setActivePluginRegistry(registry, cacheKey);
|
||||
initializeGlobalHookRunner(registry);
|
||||
activatePluginRegistry(registry, cacheKey);
|
||||
return registry;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user