on main help sign in
fix: correct model selection index in models dialog
commit1649dd0aa25eb8aecf8a5b2e263c5cca482631b0 authorKujtim Hoxha <kujtimii.h@gmail.com> dateFri 27 Jun 2025, 17:47 (1 year ago) parent135aceb
1 file changed+3−3
internal/tui/components/dialogs/models/models.go+3−3
internal/tui/components/dialogs/models/models.go+3−3
@@ -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