* Resolve a model id, breaking provider ties in favor of `defaults.provider`. * * A bare model id (e.g. `glm-5.2`) is ambiguous when two providers serve it — the * model index's bare key holds whichever was registered last, so routing could pick * the wrong provider (and its possibly-inv
(modelId: string)
| 244 | * the configured default provider actually serves it, resolve the qualified |
| 245 | * `${defaults.provider}/${id}` first; otherwise fall back to the plain resolution. |
| 246 | */ |
| 247 | private resolvePreferringDefaultProvider(modelId: string): ReturnType<typeof this.resolveModel> { |
| 248 | if (!modelId.includes('/')) { |
| 249 | const qualified = this.resolveModel(`${this.config.defaults.provider}/${modelId}`); |
| 250 | if (qualified) return qualified; |
| 251 | } |
| 252 | return this.resolveModel(modelId); |
| 253 | } |
| 254 | |
| 255 | /** |