refactor(plugins): move plugin contributions into the registry bundle (#117372)

* refactor(plugins): move plugin contributions into the registry bundle

* fix(plugins): guard embedding owner union and drop unused test-util imports

* fix(plugins): break registry facade import cycles

* fix(plugins): remove obsolete registry snapshot seams

* test(gateway): preserve plugin runtime mock exports

* test(auto-reply): install builder registry in diagnostics fixture

* test(plugins): activate registry-backed capability fixtures
This commit is contained in:
Peter Steinberger
2026-08-01 06:57:01 -07:00
committed by GitHub
parent 339b8270bb
commit e4d1b7e0d3
76 changed files with 2187 additions and 2258 deletions
+11 -1
View File
@@ -9,9 +9,12 @@ import {
import {
clearEmbeddingProviders,
clearMemoryEmbeddingProviders,
createEmptyPluginRegistry,
getActivePluginRegistry,
getRegisteredEmbeddingProvider,
setActivePluginRegistry,
} from "openclaw/plugin-sdk/plugin-test-runtime";
import { afterEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
const memoryHostEmbeddingMocks = vi.hoisted(() => ({
createLocalEmbeddingProvider: vi.fn(),
@@ -32,6 +35,11 @@ type MemoryCreateTestOptions = AdapterCreateOptions & {
fallback?: "none";
outputDimensionality?: number;
};
let previousPluginRegistry: ReturnType<typeof getActivePluginRegistry>;
beforeEach(() => {
previousPluginRegistry = getActivePluginRegistry();
});
async function createLlamaCppMemoryEmbeddingProvider(options: MemoryCreateTestOptions) {
const { fallback: _fallback, outputDimensionality, ...adapterOptions } = options;
@@ -44,6 +52,7 @@ async function createLlamaCppMemoryEmbeddingProvider(options: MemoryCreateTestOp
afterEach(() => {
clearEmbeddingProviders();
clearMemoryEmbeddingProviders();
setActivePluginRegistry(previousPluginRegistry ?? createEmptyPluginRegistry());
memoryHostEmbeddingMocks.createLocalEmbeddingProvider.mockReset();
});
@@ -88,6 +97,7 @@ describe("llama.cpp provider plugin", () => {
},
register: llamaCppPlugin.register,
});
setActivePluginRegistry(registry.registry);
const provider = getRegisteredEmbeddingProvider("local");
expect(provider?.ownerPluginId).toBe("llama-cpp");