@@ -283,6 +283,10 @@ func TestConvertProvidersToModelList_PreservesUserModel_OpenAI(t *testing.T) {
283283 t .Fatalf ("len(result) = %d, want 1" , len (result ))
284284 }
285285
286+ if result [0 ].ModelName != "gpt-4-turbo" {
287+ t .Errorf ("ModelName = %q, want %q" , result [0 ].ModelName , "gpt-4-turbo" )
288+ }
289+
286290 if result [0 ].Model != "openai/gpt-4-turbo" {
287291 t .Errorf ("Model = %q, want %q" , result [0 ].Model , "openai/gpt-4-turbo" )
288292 }
@@ -331,11 +335,43 @@ func TestConvertProvidersToModelList_PreservesUserModel_Qwen(t *testing.T) {
331335 t .Fatalf ("len(result) = %d, want 1" , len (result ))
332336 }
333337
338+ if result [0 ].ModelName != "qwen-plus" {
339+ t .Errorf ("ModelName = %q, want %q" , result [0 ].ModelName , "qwen-plus" )
340+ }
341+
334342 if result [0 ].Model != "qwen/qwen-plus" {
335343 t .Errorf ("Model = %q, want %q" , result [0 ].Model , "qwen/qwen-plus" )
336344 }
337345}
338346
347+ func TestConvertProvidersToModelList_PreservesUserModelName_Ollama (t * testing.T ) {
348+ cfg := & Config {
349+ Agents : AgentsConfig {
350+ Defaults : AgentDefaults {
351+ Provider : "ollama" ,
352+ Model : "llama3.2" ,
353+ },
354+ },
355+ Providers : ProvidersConfig {
356+ Ollama : ProviderConfig {
357+ APIBase : "http://localhost:11434/v1" ,
358+ },
359+ },
360+ }
361+
362+ result := ConvertProvidersToModelList (cfg )
363+
364+ if len (result ) != 1 {
365+ t .Fatalf ("len(result) = %d, want 1" , len (result ))
366+ }
367+ if result [0 ].ModelName != "llama3.2" {
368+ t .Fatalf ("ModelName = %q, want %q" , result [0 ].ModelName , "llama3.2" )
369+ }
370+ if result [0 ].Model != "ollama/llama3.2" {
371+ t .Fatalf ("Model = %q, want %q" , result [0 ].Model , "ollama/llama3.2" )
372+ }
373+ }
374+
339375func TestConvertProvidersToModelList_UsesDefaultWhenNoUserModel (t * testing.T ) {
340376 cfg := & Config {
341377 Agents : AgentsConfig {
0 commit comments