on main help sign in
Merge pull request #354 from charmbracelet/prevent_model_switch

chore: prevent switching the model while agent is working

commit287fc20a1c3c14190a4aebd96c95d481080ef0d2 authorKujtim Hoxha <kujtimii.h@gmail.com> dateWed 30 Jul 2025, 16:05 (1 year ago) parent803b49f121825d
1 file changed+3
internal/tui/tui.go+3
internal/tui/tui.go+3
@@ -180,6 +180,9 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
180180 return a, a.handleWindowResize(a.wWidth, a.wHeight)
181181 // Model Switch
182182 case models.ModelSelectedMsg:
183+ if a.app.CoderAgent.IsBusy() {
184+ return a, util.ReportWarn("Agent is busy, please wait...")
185+ }
183186 config.Get().UpdatePreferredModel(msg.ModelType, msg.Model)
184187
185188 // Update the agent with the new model/provider configuration