feat(ai): add personal summary models and retire Q&A

Add an admin-managed provider model catalog with per-user summary selection, migration backfill, and generation snapshots. Retire report creation and messaging while preserving owner-scoped history.

Refs #15 #16

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 20:45:21 +01:00
parent ac17d27f51
commit 989996fbd6
53 changed files with 2228 additions and 979 deletions

View File

@ -172,6 +172,10 @@ func (h *Handler) SetActiveAIProvider(c *gin.Context) {
func (h *Handler) DeleteAIProvider(c *gin.Context) {
if err := h.repo.DeleteAIProvider(c.Param("id")); err != nil {
if errors.Is(err, models.ErrCatalogConflict) {
c.JSON(409, gin.H{"error": "provider_in_use"})
return
}
httputil.InternalError(c, err)
return
}
@ -359,7 +363,7 @@ func (h *Handler) GetDefaultSystemPrompt(c *gin.Context) {
// ── AI Roles ───────────────────────────────────────────────────────────────
func (h *Handler) GetAIRoles(c *gin.Context) {
roles := []string{"summary", "report", "filter"}
roles := []string{"summary"}
resp := gin.H{}
for _, role := range roles {
providerID, _ := h.repo.GetSetting("ai_role_" + role + "_provider")
@ -376,8 +380,8 @@ type updateAIRoleRequest struct {
func (h *Handler) UpdateAIRole(c *gin.Context) {
role := c.Param("role")
if role != "summary" && role != "report" && role != "filter" {
httputil.BadRequest(c, fmt.Errorf("invalid role: must be summary, report, or filter"))
if role != "summary" {
httputil.BadRequest(c, fmt.Errorf("legacy role is not configurable"))
return
}
var req updateAIRoleRequest