diff --git a/coderd/aitasks.go b/coderd/aitasks.go index 61c7df396f..7161eec510 100644 --- a/coderd/aitasks.go +++ b/coderd/aitasks.go @@ -675,7 +675,7 @@ func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) { }) } - if v, ok := respBody["status"].(string); !ok || v != "ok" { + if v, ok := respBody["ok"].(bool); !ok || !v { return httperror.NewResponseError(http.StatusBadGateway, codersdk.Response{ Message: "Task app rejected the message.", Detail: fmt.Sprintf("Upstream response: %v", respBody), diff --git a/coderd/aitasks_test.go b/coderd/aitasks_test.go index 9b49aa731e..6e51a6917d 100644 --- a/coderd/aitasks_test.go +++ b/coderd/aitasks_test.go @@ -449,7 +449,7 @@ func TestTasks(t *testing.T) { assert.Equal(t, `{"content":"Hello, Agent!","type":"user"}`, string(b), "expected message content") w.WriteHeader(http.StatusOK) - io.WriteString(w, `{"status": "ok"}`) + io.WriteString(w, `{"ok": true}`) return } w.WriteHeader(http.StatusInternalServerError)