X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/2a276c273c21a1752d541bf87e074c5d1c27e30f..3aa065806f87d0876fbd7b05e5ded4aad380cc73:/compactor_test.go?ds=sidebyside diff --git a/compactor_test.go b/compactor_test.go index 8540515..dcd9c33 100644 --- a/compactor_test.go +++ b/compactor_test.go @@ -129,16 +129,19 @@ func TestCompactorFailsWithoutALine(t *testing.T) { want string }{ { - name: "failed call", + name: "reports the model call failure", reply: func(w http.ResponseWriter, _ ModelFakeCall) { w.WriteHeader(http.StatusInternalServerError) - _, _ = io.WriteString(w, "down") + _, err := io.WriteString(w, "down") + if err != nil { + panic(err) + } }, want: "HTTP 500", }, { - name: "tool call and no text", + name: "refuses a response without summary text", reply: func(w http.ResponseWriter, _ ModelFakeCall) { modelWriteEvents(w, modelCompletedEvent([]any{map[string]any{"type": "function_call", "name": "zoom", "arguments": "{}"}}, 100, 0, 5)) }, @@ -208,7 +211,7 @@ func newTestCompactor(t *testing.T, server *ModelFake) *Compactor { return newCompactor(client, compactorAdaPrompt, ModelConfig{ Model: "gpt-test", Effort: "high", - }, promptTools()) + }, promptTools(), &ImageStore{dir: t.TempDir()}) } // compactorInputTexts returns the text of each user message of call. Each