mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:10:51 +00:00
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:
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user