@@ -45,6 +45,7 @@ vi.mock("../../plugins/provider-discovery.js", async (importOriginal) => ({
4545
4646import { getModelProviderRequestTransport } from "../provider-request-config.js" ;
4747import {
48+ canonicalizeManifestModelCatalogProviderAlias ,
4849 createBundledProviderStaticCatalogContextResolver ,
4950 createBundledProviderStaticCatalogModelResolver ,
5051 createBundledStaticCatalogModelResolver ,
@@ -137,6 +138,28 @@ beforeEach(() => {
137138 providerMocks . normalizePluginDiscoveryResult . mockReturnValue ( { } ) ;
138139} ) ;
139140
141+ describe ( "canonicalizeManifestModelCatalogProviderAlias" , ( ) => {
142+ it ( "canonicalizes unambiguous manifest-owned aliases" , ( ) => {
143+ manifestMocks . loadPluginManifestRegistry . mockReturnValue ( {
144+ plugins : [
145+ {
146+ providers : [ "moonshot" ] ,
147+ modelCatalog : {
148+ aliases : {
149+ "moonshot-ai" : { provider : "moonshot" } ,
150+ moonshotai : { provider : "moonshot" } ,
151+ } ,
152+ } ,
153+ } ,
154+ ] ,
155+ } ) ;
156+
157+ for ( const provider of [ "moonshotai" , "moonshot-ai" ] ) {
158+ expect ( canonicalizeManifestModelCatalogProviderAlias ( { provider } ) ) . toBe ( "moonshot" ) ;
159+ }
160+ } ) ;
161+ } ) ;
162+
140163describe ( "resolveBundledStaticCatalogModel" , ( ) => {
141164 it ( "reuses one manifest scan across prepared lookups" , ( ) => {
142165 setManifestPlugins ( [ createMistralManifestPlugin ( ) ] ) ;
0 commit comments