mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 03:21:23 +00:00
perf(test): speed up vitest by skipping plugins + LLM slug
This commit is contained in:
@@ -3,6 +3,7 @@ import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agents/agent
|
||||
import { loadConfig } from "../config/config.js";
|
||||
import { createSubsystemLogger } from "../logging.js";
|
||||
import { loadOpenClawPlugins } from "../plugins/loader.js";
|
||||
import { getActivePluginRegistry } from "../plugins/runtime.js";
|
||||
|
||||
const log = createSubsystemLogger("plugins");
|
||||
let pluginRegistryLoaded = false;
|
||||
@@ -11,6 +12,16 @@ export function ensurePluginRegistryLoaded(): void {
|
||||
if (pluginRegistryLoaded) {
|
||||
return;
|
||||
}
|
||||
const active = getActivePluginRegistry();
|
||||
// Tests (and callers) can pre-seed a registry (e.g. `test/setup.ts`); avoid
|
||||
// doing an expensive load when we already have plugins/channels/tools.
|
||||
if (
|
||||
active &&
|
||||
(active.plugins.length > 0 || active.channels.length > 0 || active.tools.length > 0)
|
||||
) {
|
||||
pluginRegistryLoaded = true;
|
||||
return;
|
||||
}
|
||||
const config = loadConfig();
|
||||
const workspaceDir = resolveAgentWorkspaceDir(config, resolveDefaultAgentId(config));
|
||||
const logger: PluginLogger = {
|
||||
|
||||
Reference in New Issue
Block a user