fix(coding-agent): skip unauthenticated default model

closes #6231
This commit is contained in:
Vegard Stikbakke
2026-07-02 10:48:11 +02:00
parent 6757561546
commit ca09b2b1a8
3 changed files with 42 additions and 2 deletions
@@ -596,10 +596,10 @@ export async function findInitialModel(options: {
};
}
// 3. Try saved default from settings
// 3. Try saved default from settings if auth is configured.
if (defaultProvider && defaultModelId) {
const found = modelRegistry.find(defaultProvider, defaultModelId);
if (found) {
if (found && modelRegistry.hasConfiguredAuth(found)) {
model = found;
if (defaultThinkingLevel) {
thinkingLevel = defaultThinkingLevel;