fix(coderd): fix parsing of response format in tasks send (#19960)

This commit is contained in:
Mathias Fredriksson
2025-09-25 13:50:42 +00:00
committed by GitHub
parent fc9bff7107
commit 653101e5f6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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),
+1 -1
View File
@@ -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)