]> git.giacomolli.uk - onechat/blobdiff - compactor_test.go
Check the complete message before committing
[onechat] / compactor_test.go
index eaed4feeeb9373b58a59a6b6fa29a4a4980cc016..493402551e6d8bf7fa8697b96d3ef27476d815c1 100644 (file)
@@ -129,7 +129,7 @@ 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)
 
@@ -138,7 +138,7 @@ func TestCompactorFailsWithoutALine(t *testing.T) {
                        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 +208,7 @@ func newTestCompactor(t *testing.T, server *ModelFake) *Compactor {
        return newCompactor(client, compactorAdaPrompt, ModelConfig{
                Model:  "gpt-test",
                Effort: "high",
-       })
+       }, promptTools(), &ImageStore{dir: t.TempDir()})
 }
 
 // compactorInputTexts returns the text of each user message of call. Each