fix(tui): keep selected model name updated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
3a90e1945f
commit
6214f2308f
1 changed files with 4 additions and 0 deletions
|
|
@ -103,7 +103,11 @@ func (s *appState) modelForm(index int) tview.Primitive {
|
||||||
s.showMessage("Duplicate model name", fmt.Sprintf("Model Name '%s' already exists", value))
|
s.showMessage("Duplicate model name", fmt.Sprintf("Model Name '%s' already exists", value))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
oldName := model.ModelName
|
||||||
model.ModelName = value
|
model.ModelName = value
|
||||||
|
if s.config.Agents.Defaults.Model == oldName {
|
||||||
|
s.config.Agents.Defaults.Model = value
|
||||||
|
}
|
||||||
s.dirty = true
|
s.dirty = true
|
||||||
form.SetTitle(fmt.Sprintf("Model: %s", model.ModelName))
|
form.SetTitle(fmt.Sprintf("Model: %s", model.ModelName))
|
||||||
refreshMainMenuIfPresent(s)
|
refreshMainMenuIfPresent(s)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue