]> git.giacomolli.uk - onechat/blobdiff - compactor_test.go
Sync agent queue replacements before success
[onechat] / compactor_test.go
index baa7f57ed7c6c88db4342403ea8f2093b793c5f5..dcd9c3379edc5d984707c26c815f106923ef2349 100644 (file)
@@ -129,16 +129,19 @@ func TestCompactorFailsWithoutALine(t *testing.T) {
                want  string
        }{
                {
                want  string
        }{
                {
-                       name: "failed call",
+                       name: "reports the model call failure",
                        reply: func(w http.ResponseWriter, _ ModelFakeCall) {
                                w.WriteHeader(http.StatusInternalServerError)
 
                        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",
                },
                {
                        },
                        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))
                        },
                        reply: func(w http.ResponseWriter, _ ModelFakeCall) {
                                modelWriteEvents(w, modelCompletedEvent([]any{map[string]any{"type": "function_call", "name": "zoom", "arguments": "{}"}}, 100, 0, 5))
                        },