chore: prevent switching the model while agent is working

This commit is contained in:
Kujtim Hoxha
2025-07-30 12:39:56 +02:00
parent ebf3b43b4a
commit 121825d8e3

View File

@@ -180,6 +180,9 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return a, a.handleWindowResize(a.wWidth, a.wHeight) return a, a.handleWindowResize(a.wWidth, a.wHeight)
// Model Switch // Model Switch
case models.ModelSelectedMsg: case models.ModelSelectedMsg:
if a.app.CoderAgent.IsBusy() {
return a, util.ReportWarn("Agent is busy, please wait...")
}
config.Get().UpdatePreferredModel(msg.ModelType, msg.Model) config.Get().UpdatePreferredModel(msg.ModelType, msg.Model)
// Update the agent with the new model/provider configuration // Update the agent with the new model/provider configuration