From 4b6ac2a2135fc63f3f98a25d6d03757b0683a8ee Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 17:07:20 +0200 Subject: [PATCH] test(web): chat over an upload opens with the upload chat model (red) Red: App.UploadChatModel is undefined. Co-Authored-By: Claude Sonnet 5.5 --- internal/web/uploads_chat_handler_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/web/uploads_chat_handler_test.go b/internal/web/uploads_chat_handler_test.go index bc1ce72..ff6f96f 100644 --- a/internal/web/uploads_chat_handler_test.go +++ b/internal/web/uploads_chat_handler_test.go @@ -165,3 +165,18 @@ func TestUploadStatus_DoneOffersTheChatLinkOnlyWhenChatIsWired(t *testing.T) { id2 := seedUpload(t, userID, "m2", "done", meetingText) assert.NotContains(t, body(t, do(t, appWithout, get("/uploads/"+id2+"/status"))), "/chat") } + +func TestUploadChat_OpensWithTheUploadChatModelNotTheSummarizerDefault(t *testing.T) { + // koala/phi4-mini is first in the offered list (it is the summarizer default) and + // has an 8,192-token context: an hour of speech returns HTTP 400 there. Chat over + // an upload must open with the model configured for it. + app, fc := newUploadChatApp(t) + app.UploadChatModel = "iguana/gemma4-26b" + id := seedUpload(t, userID, "m", "done", meetingText) + + page := body(t, do(t, app, get("/uploads/"+id+"/chat"))) + do(t, app, chatPost("/uploads/"+id+"/chat", url.Values{"question": {"q"}})) + + assert.Contains(t, page, `