Fix model fallback crash on undefined provider/model (#946)

This commit is contained in:
Roshan Singh
2026-01-15 11:58:15 +00:00
committed by Peter Steinberger
parent 2d1ae0916f
commit 0f27cff247
2 changed files with 30 additions and 2 deletions
+2 -2
View File
@@ -119,8 +119,8 @@ function resolveFallbackCandidates(params: {
/** Optional explicit fallbacks list; when provided (even empty), replaces agents.defaults.model.fallbacks. */
fallbacksOverride?: string[];
}): ModelCandidate[] {
const provider = params.provider.trim() || DEFAULT_PROVIDER;
const model = params.model.trim() || DEFAULT_MODEL;
const provider = String(params.provider ?? "").trim() || DEFAULT_PROVIDER;
const model = String(params.model ?? "").trim() || DEFAULT_MODEL;
const primary = params.cfg
? resolveConfiguredModelRef({
cfg: params.cfg,