perf: avoid duplicate provider policy artifact misses

This commit is contained in:
Peter Steinberger
2026-05-06 16:17:58 +01:00
parent 167e43345a
commit 99b17263a1

View File

@@ -102,10 +102,13 @@ export function resolveBundledProviderPolicySurface(
if (!normalizedProviderId) {
return null;
}
return (
tryLoadBundledProviderPolicySurface(normalizedProviderId) ??
tryLoadBundledProviderPolicySurface(
resolveBundledProviderPolicyPluginId(normalizedProviderId, options) ?? normalizedProviderId,
)
);
const directSurface = tryLoadBundledProviderPolicySurface(normalizedProviderId);
if (directSurface) {
return directSurface;
}
const ownerPluginId = resolveBundledProviderPolicyPluginId(normalizedProviderId, options);
if (!ownerPluginId || ownerPluginId === normalizedProviderId) {
return null;
}
return tryLoadBundledProviderPolicySurface(ownerPluginId);
}