test: narrow web search contract runtime loads

Honor targeted includes in the contracts Vitest lane and compare bundled
web-search fast-path artifacts against plugin-owned runtime artifacts instead
of loading whole plugin entries. Split Google and Firecrawl runtime-only work
behind lazy seams so provider registration stays metadata-light.

Also keep Perplexity contract metadata aligned by sharing its runtime transport
resolution with the contract artifact.
This commit is contained in:
Gustavo Madeira Santana
2026-04-17 17:07:56 -04:00
parent c03f97f954
commit 2482e70fb8
12 changed files with 482 additions and 362 deletions

View File

@@ -1,8 +1,10 @@
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../src/config/config.js";
import { resolveManifestContractOwnerPluginId } from "../../../src/plugins/manifest-registry.js";
import { resolveBundledExplicitWebSearchProvidersFromPublicArtifacts } from "../../../src/plugins/web-provider-public-artifacts.explicit.js";
import { resolvePluginWebSearchProviders } from "../../../src/plugins/web-search-providers.runtime.js";
import {
resolveBundledExplicitRuntimeWebSearchProvidersFromPublicArtifacts,
resolveBundledExplicitWebSearchProvidersFromPublicArtifacts,
} from "../../../src/plugins/web-provider-public-artifacts.explicit.js";
type ComparableProvider = {
pluginId: string;
@@ -94,19 +96,16 @@ export function describeBundledWebSearchFastPathContract(pluginId: string) {
}
});
it("keeps fast-path provider metadata aligned with bundled public artifacts", async () => {
const fastPathProviders = resolvePluginWebSearchProviders({
origin: "bundled",
onlyPluginIds: [pluginId],
mode: "setup",
}).filter((provider) => provider.pluginId === pluginId);
const bundledProviderEntries =
it("keeps fast-path provider metadata aligned with the bundled runtime artifact", async () => {
const fastPathProviders =
resolveBundledExplicitWebSearchProvidersFromPublicArtifacts({
onlyPluginIds: [pluginId],
})?.filter((provider) => provider.pluginId === pluginId) ?? [];
const bundledProviderEntries =
resolveBundledExplicitRuntimeWebSearchProvidersFromPublicArtifacts({
onlyPluginIds: [pluginId],
})?.filter((entry) => entry.pluginId === pluginId) ?? [];
expect(bundledProviderEntries.length).toBeGreaterThan(0);
expect(
sortComparableEntries(
fastPathProviders.map((provider) =>