From 6c39ab86cf1e41d16f4d3391652634aa71085936 Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 17:07:33 +0200 Subject: [PATCH] feat(web): chat over an upload opens with App.UploadChatModel The Chatter's own default is the summarizer's (koala/phi4-mini, 8,192-token context), which answers HTTP 400 on an hour of speech. Empty keeps the old behaviour. Co-Authored-By: Claude Sonnet 5.5 --- internal/web/handlers.go | 5 +++++ internal/web/uploads.go | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/web/handlers.go b/internal/web/handlers.go index b9b1ed2..3867181 100644 --- a/internal/web/handlers.go +++ b/internal/web/handlers.go @@ -117,6 +117,11 @@ type App struct { // recording. The caption default (18,000 chars, ~22 minutes of speech) would // keep only the first third of an hour-long meeting. UploadChatMaxChars int + // UploadChatModel is the model chat over an uploaded recording opens with. Empty + // means the Chatter's own default. It exists because that default is the + // summarizer's (koala/phi4-mini, 8,192-token context) and cannot hold an hour of + // speech. + UploadChatModel string // Processing tracks in-flight immediate summarizations so the status endpoint // shows the animation until the summary lands. The zero value is ready to use. Processing ProcessingSet diff --git a/internal/web/uploads.go b/internal/web/uploads.go index 295ced5..bd65624 100644 --- a/internal/web/uploads.go +++ b/internal/web/uploads.go @@ -206,7 +206,7 @@ func (a *App) handleUploadChat(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/uploads/"+u.ID, http.StatusSeeOther) return } - a.render(w, r, UploadChatPage(*u, a.uploadChatView(*u, a.Chat.DefaultModel(""), nil, false, ""))) + a.render(w, r, UploadChatPage(*u, a.uploadChatView(*u, a.Chat.DefaultModel(a.UploadChatModel), nil, false, ""))) } // handleUploadChatMessage answers one question against the owner's uploaded @@ -226,7 +226,7 @@ func (a *App) handleUploadChatMessage(w http.ResponseWriter, r *http.Request) { http.Error(w, "bad form", http.StatusBadRequest) return } - model := a.resolveModel(r.FormValue("model"), "") + model := a.resolveModel(r.FormValue("model"), a.UploadChatModel) history := parseHistory(r.Form["hq"], r.Form["ha"]) question := strings.TrimSpace(r.FormValue("question"))