on main help sign in
Merge pull request #354 from charmbracelet/prevent_model_switch
287fc20Kujtim Hoxha
internal/tui/tui.go+3
@@ -180,6 +180,9 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
180 return a, a.handleWindowResize(a.wWidth, a.wHeight)
180 return a, a.handleWindowResize(a.wWidth, a.wHeight)
181 // Model Switch
181 // Model Switch
182 case models.ModelSelectedMsg:
182 case models.ModelSelectedMsg:
183+ if a.app.CoderAgent.IsBusy() {
184+ return a, util.ReportWarn("Agent is busy, please wait...")
185+ }
183 config.Get().UpdatePreferredModel(msg.ModelType, msg.Model)
186 config.Get().UpdatePreferredModel(msg.ModelType, msg.Model)
184
187
185 // Update the agent with the new model/provider configuration
188 // Update the agent with the new model/provider configuration