mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-06 15:18:58 +00:00
test(perf): avoid spawn workspace plugin metadata scans
This commit is contained in:
@@ -14,6 +14,7 @@ import type {
|
||||
IngestResult,
|
||||
} from "../../../context-engine/types.js";
|
||||
import { formatErrorMessage } from "../../../infra/errors.js";
|
||||
import type { PluginMetadataSnapshot } from "../../../plugins/plugin-metadata-snapshot.js";
|
||||
import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalLowercaseString,
|
||||
@@ -229,6 +230,51 @@ export function getHoisted(): AttemptSpawnWorkspaceHoisted {
|
||||
return hoisted;
|
||||
}
|
||||
|
||||
const emptyPluginMetadataSnapshot: PluginMetadataSnapshot = {
|
||||
policyHash: "",
|
||||
index: {
|
||||
version: 1,
|
||||
hostContractVersion: "test",
|
||||
compatRegistryVersion: "test",
|
||||
migrationVersion: 1,
|
||||
policyHash: "",
|
||||
generatedAtMs: 1,
|
||||
installRecords: {},
|
||||
plugins: [],
|
||||
diagnostics: [],
|
||||
},
|
||||
registryDiagnostics: [],
|
||||
manifestRegistry: { plugins: [], diagnostics: [] },
|
||||
plugins: [],
|
||||
diagnostics: [],
|
||||
byPluginId: new Map(),
|
||||
normalizePluginId: (pluginId: string) => pluginId,
|
||||
owners: {
|
||||
channels: new Map(),
|
||||
channelConfigs: new Map(),
|
||||
providers: new Map(),
|
||||
modelCatalogProviders: new Map(),
|
||||
cliBackends: new Map(),
|
||||
setupProviders: new Map(),
|
||||
commandAliases: new Map(),
|
||||
contracts: new Map(),
|
||||
},
|
||||
metrics: {
|
||||
registrySnapshotMs: 0,
|
||||
manifestRegistryMs: 0,
|
||||
ownerMapsMs: 0,
|
||||
totalMs: 0,
|
||||
indexPluginCount: 0,
|
||||
manifestPluginCount: 0,
|
||||
},
|
||||
};
|
||||
|
||||
vi.mock("../../../plugins/plugin-metadata-snapshot.js", () => ({
|
||||
isPluginMetadataSnapshotCompatible: () => true,
|
||||
listPluginOriginsFromMetadataSnapshot: () => new Map(),
|
||||
loadPluginMetadataSnapshot: () => emptyPluginMetadataSnapshot,
|
||||
}));
|
||||
|
||||
vi.mock("@mariozechner/pi-coding-agent", () => {
|
||||
function AuthStorage() {}
|
||||
class DefaultResourceLoader {
|
||||
|
||||
Reference in New Issue
Block a user