@@ -2762,18 +2762,23 @@ func matchesWireRepairCandidate*(comboModel, model: string): bool =
27622762 # # `kimi-k3`). Endpoints occasionally list such ids without serving
27632763 # # them on chat/completions, and the verification ping doesn't catch
27642764 # # it (that gateway serves unknown ids too), so the wire-id repair
2765- # # rewrites them to the curated id. Only alias-shaped combos
2766- # # qualify (combo `k3`, whose normalized form is the alias expansion
2767- # # `kimi-k3`): the short ids where providers actually pull this
2768- # # trick. Dated and routing variants of ordinary combos
2765+ # # rewrites them to the curated id. Only a numeric qualifier tail
2766+ # # qualifies (`256k`): the listed-but-unserved ids providers actually
2767+ # # pull this trick with. A non-numeric tail is a designator, a
2768+ # # different model (`glm-5.3-flash` never collapses into `glm-5.3`).
2769+ # # Dated and routing variants of ordinary combos
27692770 # # (`gpt-5.5-pro`, `deepseek-v4-flash-20260731`) stay experimental
27702771 # # by design. Used only by `knownGoodWireModel`: the experimental
27712772 # # gate and the curated defaults (`isKnownGood`, `knownGoodFamily`,
27722773 # # `knownGoodReasonings`) deliberately keep the narrower matching.
27732774 if matchesKnownGoodModel (comboModel, model): return true
2775+ # The normalized combo must be the full normalized model plus one
2776+ # qualifier tail: `kimi-k3` + `256k` repairs, but `glm-5.3` +
2777+ # `flash` is a different designator, a different model.
27742778 let normCombo = normalizeModelName (comboModel)
2775- if normCombo != aliasExpansion (comboModel): return false
2776- aliasExpansion (model).startsWith (normCombo & " -" )
2779+ if not normalizeModelName (model).startsWith (normCombo & " -" ): return false
2780+ let tail = normalizeModelName (model)[normCombo.len + 1 .. ^ 1 ]
2781+ tail.split ('-' ).allIt (it.len > 0 and it[0 ] in {'0' .. '9' })
27772782
27782783proc canonicalKnownGoodProvider * (provider: string ): string =
27792784 # # Map config provider names onto the KnownGoodCombos provider key.
0 commit comments