Commit e9d91de
committed
fix(moonshot): accept moonshotai/<model> as direct-API alias
Users copying a Kimi model id from OpenRouter (which lists models as
moonshotai/kimi-k2.6) and dropping the openrouter/ prefix to hit the
direct API saw 'Unknown model: moonshotai/kimi-k2.6'. The direct
provider was registered only as moonshot, so only moonshot/kimi-k2.6
resolved. The OpenRouter org slug, Moonshot AI's own branding, and the
existing moonshot manifest's modelPricing.providers.moonshot.openRouter
entry all use the moonshotai form — only the direct-API name disagreed.
The OpenAI plugin already shipped the manifest pattern for this exact
shape (azure-openai-responses → openai), and there's a planner test
that pins it down. Reuse the same modelCatalog.aliases mechanism in
the moonshot manifest:
"modelCatalog": {
"aliases": {
"moonshotai": { "provider": "moonshot" }
},
...
}
This keeps moonshot as the canonical id (no rename, no breaking
change for operators whose configs already say moonshot/...). The
catalog planner now resolves moonshotai/<model> through moonshot's
existing models list, baseUrl, api class, discovery, pricing, and
auth choices unchanged. providers, providerEndpoints,
providerRequest, providerAuthEnvVars, and providerAuthChoices stay
keyed on moonshot — no duplication, no provider-id divergence.
Test: new planner case in
src/model-catalog/manifest-planner.test.ts mirrors the existing
azure-openai-responses test — asserts that with providerFilter:
'moonshotai' the planner returns rows with ref 'moonshotai/<model>'
and the moonshot catalog's api/baseUrl/discovery values. The existing
moonshot plugin-registration contract test continues to pass against
the modified manifest (canonical providerIds: ['moonshot']
unchanged).
Closes #738761 parent 25f0b5d commit e9d91de
2 files changed
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
146 | 203 | | |
147 | 204 | | |
148 | 205 | | |
| |||
0 commit comments