feat(models): let system admins edit builtin model config

Allow platform system administrators to update builtin model parameters
and credentials from the management UI while keeping secrets masked in API
responses. UI edits clear YAML ownership so startup reconciliation no
longer overwrites runtime overrides.
This commit is contained in:
wizardchen
2026-07-14 15:51:32 +08:00
committed by lyingbug
parent f409bd756b
commit e1572b71b9
20 changed files with 328 additions and 35 deletions
+8
View File
@@ -66,6 +66,10 @@ func (h *ModelCredentialsHandler) Put(c *gin.Context) {
c.Error(errors.NewNotFoundError("Model not found"))
return
}
if appErr, ok := errors.IsAppError(err); ok {
c.Error(appErr)
return
}
logger.ErrorWithFields(ctx, err, map[string]interface{}{"model_id": secutils.SanitizeForLog(id)})
c.Error(errors.NewInternalServerError("failed to update credentials: " + err.Error()))
return
@@ -98,6 +102,10 @@ func (h *ModelCredentialsHandler) DeleteField(c *gin.Context) {
c.Error(errors.NewNotFoundError("Model not found"))
return
}
if appErr, ok := errors.IsAppError(err); ok {
c.Error(appErr)
return
}
logger.ErrorWithFields(ctx, err, map[string]interface{}{
"model_id": secutils.SanitizeForLog(id),
"field": field,