From 89ae8d9a8e6e3988257d49d071ed2a35f13bb331 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Thu, 17 Sep 2026 13:50:48 +0200 Subject: [PATCH 10/10] feat: keep large and small model selections in sync Picking a model for one slot in the model picker now applies it to the other slot too, so a single choice covers both the large and small task models. Users running a single model no longer have to select it twice or tolerate a default small model they did not choose. --- internal/ui/model/ui.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/ui/model/ui.go b/internal/ui/model/ui.go index f26987f4..f5ffc9a4 100644 --- a/internal/ui/model/ui.go +++ b/internal/ui/model/ui.go @@ -2782,22 +2782,22 @@ func (m *UI) handleSelectModel(msg dialog.ActionSelectModel) tea.Cmd { if err := m.com.Workspace.UpdatePreferredModel(config.ScopeGlobal, msg.ModelType, msg.Model); err != nil { cmds = append(cmds, util.ReportError(err)) } else { - if msg.ModelType == config.SelectedModelTypeLarge { - // Swap the theme live based on the newly selected large - // model's provider and terminal background. Skipped when the - // provider resolves to the already-active theme, which avoids - // a full markdown re-render of the transcript on every - // selection. - hasDarkBG := lipgloss.HasDarkBackground(os.Stdin, os.Stdout) - m.applyThemeForProvider(providerID, hasDarkBG) - } - if _, ok := cfg.Models[config.SelectedModelTypeSmall]; !ok { - // Ensure small model is set is unset. - smallModel := m.com.Workspace.GetDefaultSmallModel(providerID) - if err := m.com.Workspace.UpdatePreferredModel(config.ScopeGlobal, config.SelectedModelTypeSmall, smallModel); err != nil { - cmds = append(cmds, util.ReportError(err)) - } + // Keep the large and small model selections in sync: picking a + // model for either slot applies it to the other as well. + otherType := config.SelectedModelTypeSmall + if msg.ModelType == config.SelectedModelTypeSmall { + otherType = config.SelectedModelTypeLarge } + if err := m.com.Workspace.UpdatePreferredModel(config.ScopeGlobal, otherType, msg.Model); err != nil { + cmds = append(cmds, util.ReportError(err)) + } + + // The large model always ends up pointing at the selected + // provider, so swap the theme to match it. Skipped when the + // provider resolves to the already-active theme, which avoids a + // full markdown re-render of the transcript on every selection. + hasDarkBG := lipgloss.HasDarkBackground(os.Stdin, os.Stdout) + m.applyThemeForProvider(providerID, hasDarkBG) } cmds = append(cmds, m.updateAgentModelCmd(func() tea.Msg { -- 2.53.0