File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,6 +256,11 @@ const SERIALIZATION_FALLBACK_PROVIDER: ProviderId = 'openai'
256256 * provider; anything else is left to `getProviderFromModel`, which defaults an
257257 * unrecognised id to `ollama` rather than failing serialization with an error the
258258 * user cannot act on.
259+ *
260+ * The remaining throw is a blacklisted provider or model, which is env-driven and
261+ * can name the fallback itself — so recovery returns
262+ * {@link SERIALIZATION_FALLBACK_PROVIDER} outright rather than resolving a second
263+ * time through the function that just threw.
259264 */
260265export function getSerializedModelProviderId (
261266 model : unknown ,
@@ -267,11 +272,6 @@ export function getSerializedModelProviderId(
267272 try {
268273 return getProviderFromModel ( candidate )
269274 } catch {
270- /*
271- * Not a second resolve: `getProviderFromModel` also throws for a blacklisted
272- * provider or model, so a deployment that blacklists the fallback would throw
273- * here too — the one case this helper exists to absorb.
274- */
275275 return SERIALIZATION_FALLBACK_PROVIDER
276276 }
277277}
You can’t perform that action at this time.
0 commit comments