fix: fall back to bundled policy when remote document has no matching policy

When a remote compatibility document was fetched successfully but had no
policy matching the current driver/T3 Code version, the enrichment path
treated that as 'no advisory' and stripped any existing bundled advisory,
restoring the provider to ready status even if the bundled map marked it
as broken.

Now createProviderCompatibilityAdvisory tries the provided (remote)
document first, and if it yields no matching policy, falls through to
the bundled document. This matches the documented intent that the bundled
file is the fallback when the remote map has no applicable policy.
This commit is contained in:
Cursor Agent committed 2026-05-20 09:10:09 +00:00
1 parent e035af7654
commit 0883def1a8
1 file changed
+16 -2
@@ -204,12 +204,26 @@ export function createProviderCompatibilityAdvisory(input: {
readonly maintenanceCapabilities?: ProviderMaintenanceCapabilities | undefined;
readonly t3CodeVersion?: string;
}): ServerProviderCompatibilityAdvisory | undefined {
return createProviderCompatibilityAdvisoryFromDocument({
document: input.document ?? bundledProviderCompatibilityDocument,
const shared = {
driver: input.driver,
currentVersion: input.currentVersion,
maintenanceCapabilities: input.maintenanceCapabilities,
...(input.t3CodeVersion ? { t3CodeVersion: input.t3CodeVersion } : {}),
};
if (input.document) {
const advisory = createProviderCompatibilityAdvisoryFromDocument({
document: input.document,
...shared,
});
if (advisory) {
return advisory;
}
}
return createProviderCompatibilityAdvisoryFromDocument({
document: bundledProviderCompatibilityDocument,
...shared,
});
}