From d9033d73ae371f3c744d1526cf2dd28261bb16fe Mon Sep 17 00:00:00 2001 From: Ravi Tharuma Date: Sat, 11 Apr 2026 14:13:34 +0200 Subject: [PATCH] fix(runtime-fallback): keep variant in equivalence Treat parsed variant as part of runtime-fallback model equivalence so variant-only fallback hops remain distinct while preserving the existing Claude-family alias handling. Constraint: Oracle verification flagged unresolved PR #3322 review concerns about variant equivalence and remote state Rejected: Preserve provider identity in equivalence | contradicted the original live-loop fix for equivalent Claude aliases Confidence: medium Scope-risk: narrow Directive: Any future equivalence broadening must prove both live retry-loop behavior and variant/provider semantics with targeted tests before merging Tested: bun run typecheck Tested: bun test src/hooks/runtime-fallback/index.test.ts src/hooks/runtime-fallback/error-classifier.test.ts src/plugin/event.model-fallback.test.ts Not-tested: Full live end-to-end repro across all provider redundancy policies --- src/hooks/runtime-fallback/fallback-state.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/runtime-fallback/fallback-state.ts b/src/hooks/runtime-fallback/fallback-state.ts index bc49c7289..af1b2cbb8 100644 --- a/src/hooks/runtime-fallback/fallback-state.ts +++ b/src/hooks/runtime-fallback/fallback-state.ts @@ -41,10 +41,11 @@ function parseCanonicalModel(model: string): { providerID: string; modelID: stri if (!parsed?.providerID || !parsed.modelID) return undefined const canonicalModelID = canonicalizeModelID(parsed.modelID) + const variant = parsed.variant?.toLowerCase() return { providerID: canonicalizeProviderFamily(parsed.providerID, parsed.modelID), - modelID: canonicalModelID, + modelID: variant ? `${canonicalModelID}::${variant}` : canonicalModelID, } }