Providers: scope compat resolution to owning plugins

This commit is contained in:
Gustavo Madeira Santana
2026-03-16 12:45:56 +00:00
parent c186176ca3
commit 77566a1448
5 changed files with 65 additions and 3 deletions

View File

@@ -125,6 +125,34 @@ describe("resolvePluginProviders", () => {
expect(allow).not.toContain("workspace-provider");
});
it("scopes bundled provider compat expansion to the requested plugin ids", () => {
resolvePluginProviders({
config: {
plugins: {
allow: ["openrouter"],
},
},
bundledProviderAllowlistCompat: true,
onlyPluginIds: ["moonshot"],
});
expect(loadOpenClawPluginsMock).toHaveBeenCalledWith(
expect.objectContaining({
onlyPluginIds: ["moonshot"],
config: expect.objectContaining({
plugins: expect.objectContaining({
allow: expect.arrayContaining(["openrouter", "moonshot"]),
}),
}),
}),
);
const call = loadOpenClawPluginsMock.mock.calls.at(-1)?.[0];
const allow = call?.config?.plugins?.allow;
expect(allow).not.toContain("google");
expect(allow).not.toContain("kilocode");
});
it("maps provider ids to owning plugin ids via manifests", () => {
loadPluginManifestRegistryMock.mockReturnValue({
plugins: [