fix(ai): clean up local model accounts during uninstall (#14249)

* fix(ai): clean up local model accounts during uninstall

* refactor(ai): restore best-effort local model account cleanup
This commit is contained in:
ssongliu
2026-10-30 12:10:59 +08:00
committed by GitHub
parent 8bae2f6779
commit ecb264f087
2 changed files with 1 additions and 11 deletions
+1 -10
View File
@@ -1394,19 +1394,10 @@ func (a AgentService) VerifyAccount(req dto.AgentAccountVerifyReq) error {
func (a AgentService) DeleteAccount(req dto.AgentAccountDeleteReq) error {
agentAccountMutationMu.Lock()
defer agentAccountMutationMu.Unlock()
account, err := agentAccountRepo.GetFirst(repo.WithByID(req.ID))
_, err := agentAccountRepo.GetFirst(repo.WithByID(req.ID))
if err != nil {
return err
}
if account.AppInstallID != 0 && account.Provider != "ollama" {
_, err := appInstallRepo.GetFirst(repo.WithByID(account.AppInstallID))
if err == nil {
return buserr.WithDetail("ErrInvalidParams", "Delete the local inference engine instead", nil)
}
if !errors.Is(err, gorm.ErrRecordNotFound) {
return err
}
}
if err := global.DB.Transaction(func(tx *gorm.DB) error {
var agentCount int64
-1
View File
@@ -556,7 +556,6 @@ const accountButtons = [
{
label: i18n.global.t('commons.button.delete'),
permission: true,
show: (row: AI.AgentAccountItem) => !row.appInstallId || row.provider === 'ollama',
click: async (row: AI.AgentAccountItem) => {
await ElMessageBox.confirm(
i18n.global.t('commons.msg.delete', [row.name]),