fix(model-resolver): gate saved default restore on provider readiness
Restore the isProviderRequestReady() guard lost during the main merge. Tests in model-resolver.test.ts and model-resolver-initial-model-auth.test.ts require findInitialModel() to skip an unauth'd saved default and fall through to the first available model.
This commit is contained in:
parent
bafa4e483d
commit
cce3bc6828
1 changed files with 4 additions and 1 deletions
|
|
@ -474,7 +474,10 @@ export async function findInitialModel(options: {
|
|||
|
||||
// 3. Try saved default from settings — use it exactly as configured.
|
||||
// Whatever the user chose is what gets used; no silent substitution.
|
||||
if (defaultProvider && defaultModelId) {
|
||||
// Skip the saved default if its provider is not request-ready (no auth
|
||||
// available) so we fall through to an actually-usable model instead of
|
||||
// returning a stale selection every selector surface would display.
|
||||
if (defaultProvider && defaultModelId && modelRegistry.isProviderRequestReady(defaultProvider)) {
|
||||
const found = modelRegistry.find(defaultProvider, defaultModelId);
|
||||
if (found) {
|
||||
model = found;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue