mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-07 07:58:36 +00:00
fix(ci): repair plugin registry test lanes
This commit is contained in:
@@ -712,7 +712,7 @@ describe("subagent registry persistence", () => {
|
||||
|
||||
resetSubagentRegistryForTests({ persist: false });
|
||||
|
||||
const resolved = withEnv({ VITEST: undefined, NODE_ENV: "development" }, () =>
|
||||
const resolved = withEnv({ OPENCLAW_TEST_READ_SUBAGENT_RUNS_FROM_DISK: "1" }, () =>
|
||||
getSubagentRunByChildSessionKey(childSessionKey),
|
||||
);
|
||||
|
||||
@@ -758,7 +758,7 @@ describe("subagent registry persistence", () => {
|
||||
|
||||
resetSubagentRegistryForTests({ persist: false });
|
||||
|
||||
const resolved = withEnv({ VITEST: undefined, NODE_ENV: "development" }, () =>
|
||||
const resolved = withEnv({ OPENCLAW_TEST_READ_SUBAGENT_RUNS_FROM_DISK: "1" }, () =>
|
||||
getLatestSubagentRunByChildSessionKey(childSessionKey),
|
||||
);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ describe("plugins cli policy mutations", () => {
|
||||
expect(writeConfigFile).toHaveBeenCalledWith(enabledConfig);
|
||||
expect(refreshPluginRegistry).toHaveBeenCalledWith({
|
||||
config: enabledConfig,
|
||||
installRecords: {},
|
||||
reason: "policy-changed",
|
||||
});
|
||||
});
|
||||
@@ -52,6 +53,7 @@ describe("plugins cli policy mutations", () => {
|
||||
expect(nextConfig.plugins?.entries?.alpha?.enabled).toBe(false);
|
||||
expect(refreshPluginRegistry).toHaveBeenCalledWith({
|
||||
config: nextConfig,
|
||||
installRecords: {},
|
||||
reason: "policy-changed",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -91,6 +91,7 @@ vi.mock("../../plugins/loader.js", () => ({
|
||||
const clearPluginDiscoveryCache = vi.fn();
|
||||
vi.mock("../../plugins/discovery.js", () => ({
|
||||
clearPluginDiscoveryCache: () => clearPluginDiscoveryCache(),
|
||||
discoverOpenClawPlugins: () => ({ candidates: [], diagnostics: [] }),
|
||||
}));
|
||||
|
||||
import fs from "node:fs";
|
||||
|
||||
@@ -1217,7 +1217,10 @@ function resolvePluginLoadCacheContext(options: PluginLoadOptions = {}) {
|
||||
const shouldInstallBundledRuntimeDeps = options.installBundledRuntimeDeps !== false;
|
||||
const runtimeSubagentMode = resolveRuntimeSubagentMode(options.runtimeOptions);
|
||||
const coreGatewayMethodNames = Object.keys(options.coreGatewayHandlers ?? {}).toSorted();
|
||||
const installRecords = loadInstalledPluginIndexInstallRecordsSync({ env });
|
||||
const installRecords = {
|
||||
...loadInstalledPluginIndexInstallRecordsSync({ env }),
|
||||
...cfg.plugins?.installs,
|
||||
};
|
||||
const cacheKey = buildCacheKey({
|
||||
workspaceDir: options.workspaceDir,
|
||||
plugins: trustNormalized,
|
||||
@@ -1255,6 +1258,7 @@ function resolvePluginLoadCacheContext(options: PluginLoadOptions = {}) {
|
||||
shouldLoadModules: options.loadModules !== false,
|
||||
shouldInstallBundledRuntimeDeps,
|
||||
runtimeSubagentMode,
|
||||
installRecords,
|
||||
cacheKey,
|
||||
};
|
||||
}
|
||||
@@ -2157,6 +2161,7 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
|
||||
shouldInstallBundledRuntimeDeps,
|
||||
cacheKey,
|
||||
runtimeSubagentMode,
|
||||
installRecords,
|
||||
} = resolvePluginLoadCacheContext(options);
|
||||
const logger = options.logger ?? defaultLogger();
|
||||
const validateOnly = options.mode === "validate";
|
||||
@@ -2316,6 +2321,7 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
|
||||
env,
|
||||
candidates: discovery.candidates,
|
||||
diagnostics: discovery.diagnostics,
|
||||
installRecords: Object.keys(installRecords).length > 0 ? installRecords : undefined,
|
||||
});
|
||||
pushDiagnostics(registry.diagnostics, manifestRegistry.diagnostics);
|
||||
warnWhenAllowlistIsOpen({
|
||||
@@ -3180,12 +3186,20 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
|
||||
export async function loadOpenClawPluginCliRegistry(
|
||||
options: PluginLoadOptions = {},
|
||||
): Promise<PluginRegistry> {
|
||||
const { env, cfg, normalized, activationSource, autoEnabledReasons, onlyPluginIds, cacheKey } =
|
||||
resolvePluginLoadCacheContext({
|
||||
...options,
|
||||
activate: false,
|
||||
cache: false,
|
||||
});
|
||||
const {
|
||||
env,
|
||||
cfg,
|
||||
normalized,
|
||||
activationSource,
|
||||
autoEnabledReasons,
|
||||
onlyPluginIds,
|
||||
cacheKey,
|
||||
installRecords,
|
||||
} = resolvePluginLoadCacheContext({
|
||||
...options,
|
||||
activate: false,
|
||||
cache: false,
|
||||
});
|
||||
const logger = options.logger ?? defaultLogger();
|
||||
const onlyPluginIdSet = createPluginIdScopeSet(onlyPluginIds);
|
||||
const getJiti = createPluginJitiLoader(options);
|
||||
@@ -3209,6 +3223,7 @@ export async function loadOpenClawPluginCliRegistry(
|
||||
env,
|
||||
candidates: discovery.candidates,
|
||||
diagnostics: discovery.diagnostics,
|
||||
installRecords: Object.keys(installRecords).length > 0 ? installRecords : undefined,
|
||||
});
|
||||
pushDiagnostics(registry.diagnostics, manifestRegistry.diagnostics);
|
||||
warnWhenAllowlistIsOpen({
|
||||
|
||||
Reference in New Issue
Block a user