From 0883def1a89d97a136dbfa68a83673d3ac92a64a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 20 May 2026 09:10:09 +0000 Subject: [PATCH] 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. --- .../src/provider/ProviderCompatibility.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/server/src/provider/ProviderCompatibility.ts b/apps/server/src/provider/ProviderCompatibility.ts index 7d59a6703f..23af0fc566 100644 --- a/apps/server/src/provider/ProviderCompatibility.ts +++ b/apps/server/src/provider/ProviderCompatibility.ts @@ -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, }); }