@@ -260,46 +260,47 @@ func setProviderDefaults() {
260
260
// 7. Azure
261
261
262
262
// Anthropic configuration
263
- if viper .Get ("providers.anthropic.apiKey" ) != "" {
263
+ if key := viper .GetString ("providers.anthropic.apiKey" ); strings . TrimSpace ( key ) != "" {
264
264
viper .SetDefault ("agents.coder.model" , models .Claude37Sonnet )
265
265
viper .SetDefault ("agents.task.model" , models .Claude37Sonnet )
266
266
viper .SetDefault ("agents.title.model" , models .Claude37Sonnet )
267
267
return
268
268
}
269
269
270
270
// OpenAI configuration
271
- if viper .Get ("providers.openai.apiKey" ) != "" {
271
+ if key := viper .GetString ("providers.openai.apiKey" ); strings . TrimSpace ( key ) != "" {
272
272
viper .SetDefault ("agents.coder.model" , models .GPT41 )
273
273
viper .SetDefault ("agents.task.model" , models .GPT41Mini )
274
274
viper .SetDefault ("agents.title.model" , models .GPT41Mini )
275
275
return
276
276
}
277
277
278
278
// Google Gemini configuration
279
- if viper .Get ("providers.google. gemini.apiKey" ) != "" {
279
+ if key := viper .GetString ("providers.gemini.apiKey" ); strings . TrimSpace ( key ) != "" {
280
280
viper .SetDefault ("agents.coder.model" , models .Gemini25 )
281
281
viper .SetDefault ("agents.task.model" , models .Gemini25Flash )
282
282
viper .SetDefault ("agents.title.model" , models .Gemini25Flash )
283
283
return
284
284
}
285
285
286
286
// Groq configuration
287
- if viper .Get ("providers.groq.apiKey" ) != "" {
287
+ if key := viper .GetString ("providers.groq.apiKey" ); strings . TrimSpace ( key ) != "" {
288
288
viper .SetDefault ("agents.coder.model" , models .QWENQwq )
289
289
viper .SetDefault ("agents.task.model" , models .QWENQwq )
290
290
viper .SetDefault ("agents.title.model" , models .QWENQwq )
291
291
return
292
292
}
293
293
294
294
// OpenRouter configuration
295
- if viper .Get ("providers.openrouter.apiKey" ) != "" {
295
+ if key := viper .GetString ("providers.openrouter.apiKey" ); strings . TrimSpace ( key ) != "" {
296
296
viper .SetDefault ("agents.coder.model" , models .OpenRouterClaude37Sonnet )
297
297
viper .SetDefault ("agents.task.model" , models .OpenRouterClaude37Sonnet )
298
298
viper .SetDefault ("agents.title.model" , models .OpenRouterClaude35Haiku )
299
299
return
300
300
}
301
301
302
- if viper .Get ("providers.xai.apiKey" ) != "" {
302
+ // XAI configuration
303
+ if key := viper .GetString ("providers.xai.apiKey" ); strings .TrimSpace (key ) != "" {
303
304
viper .SetDefault ("agents.coder.model" , models .XAIGrok3Beta )
304
305
viper .SetDefault ("agents.task.model" , models .XAIGrok3Beta )
305
306
viper .SetDefault ("agents.title.model" , models .XAiGrok3MiniFastBeta )
@@ -314,6 +315,7 @@ func setProviderDefaults() {
314
315
return
315
316
}
316
317
318
+ // Azure OpenAI configuration
317
319
if os .Getenv ("AZURE_OPENAI_ENDPOINT" ) != "" {
318
320
viper .SetDefault ("agents.coder.model" , models .AzureGPT41 )
319
321
viper .SetDefault ("agents.task.model" , models .AzureGPT41Mini )
0 commit comments