@@ -97,13 +97,13 @@ func (m *modelDialogCmp) Init() tea.Cmd {
9797 }
9898 modelItems = append(modelItems, commands.NewItemSection(name))
9999 for _, model := range provider.Models {
100− if model.ID == agentModel.ID && provider.ID == agentProvider.ID {
101− selectIndex = len(modelItems) // Set the selected index to the current model
102− }
103100 modelItems = append(modelItems, completions.NewCompletionItem(model.Name, ModelOption{
104101 Provider: provider,
105102 Model: model,
106103 }))
104+ if model.ID == agentModel.ID && provider.ID == agentProvider.ID {
105+ selectIndex = len(modelItems) - 1 // Set the selected index to the current model
106+ }
107107 }
108108 }
109109