mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 04:56:19 +00:00
fix: honor bundled web provider compat discovery
This commit is contained in:
@@ -122,6 +122,35 @@ describe("web provider public artifact manifest fallback", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps deprecated bundledDiscovery compat discovery outside plugin allowlists", () => {
|
||||
const resolveExplicitWebSearchProviders =
|
||||
mocks.resolveBundledExplicitWebSearchProvidersFromPublicArtifacts as unknown as {
|
||||
mockImplementation: (
|
||||
implementation: (params: {
|
||||
onlyPluginIds: readonly string[];
|
||||
}) => { id: string; pluginId: string }[],
|
||||
) => void;
|
||||
};
|
||||
resolveExplicitWebSearchProviders.mockImplementation((params) =>
|
||||
params.onlyPluginIds.map((pluginId) => ({ id: pluginId, pluginId })),
|
||||
);
|
||||
|
||||
const providers = resolveBundledWebSearchProvidersFromPublicArtifacts({
|
||||
config: {
|
||||
plugins: {
|
||||
allow: ["some-other-plugin"],
|
||||
bundledDiscovery: "compat",
|
||||
},
|
||||
},
|
||||
onlyPluginIds: ["fallback-search"],
|
||||
});
|
||||
|
||||
expect(providers).toEqual([{ id: "fallback-search", pluginId: "fallback-search" }]);
|
||||
expect(mocks.resolveBundledExplicitWebSearchProvidersFromPublicArtifacts).toHaveBeenCalledWith({
|
||||
onlyPluginIds: ["fallback-search"],
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps manifest bundled web-fetch public artifact candidates inside allowlist discovery", () => {
|
||||
mocks.loadPluginMetadataSnapshot.mockReturnValueOnce({
|
||||
diagnostics: [],
|
||||
|
||||
@@ -31,6 +31,11 @@ function filterAllowlistedBundledPluginIds(
|
||||
config: PluginLoadOptions["config"] | undefined,
|
||||
pluginIds: readonly string[],
|
||||
) {
|
||||
// Deprecated shipped compat marker: old allowlist configs used this to keep
|
||||
// bundled web provider discovery available while plugin IDs were tightened.
|
||||
if (config?.plugins?.bundledDiscovery === "compat") {
|
||||
return [...pluginIds];
|
||||
}
|
||||
const allow = config?.plugins?.allow;
|
||||
if (!Array.isArray(allow) || allow.length === 0) {
|
||||
return [...pluginIds];
|
||||
|
||||
Reference in New Issue
Block a user