Skip to content

Commit 523a67f

Browse files
committed
fix(blocks): move the fallback rationale into TSDoc
The repo forbids non-TSDoc comments; the explanation for why recovery returns a constant instead of resolving again belongs on the declaration anyway.
1 parent 2fedeb0 commit 523a67f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

apps/sim/blocks/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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
*/
260265
export 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
}

0 commit comments

Comments
 (0)