mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
chore: prevent switching the model while agent is working
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user