From cd0354e86cc40e12ee9e67a28a753422db8b96b2 Mon Sep 17 00:00:00 2001 From: clawbot Date: Fri, 20 Feb 2026 03:32:42 -0800 Subject: [PATCH] fix: API deploy handler uses detached context to prevent cancellation (closes #105) --- internal/handlers/api.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/handlers/api.go b/internal/handlers/api.go index 047b6d7..6667906 100644 --- a/internal/handlers/api.go +++ b/internal/handlers/api.go @@ -1,6 +1,7 @@ package handlers import ( + "context" "encoding/json" "net/http" "strconv" @@ -344,7 +345,11 @@ func (h *Handlers) HandleAPITriggerDeploy() http.HandlerFunc { return } - deployErr := h.deploy.Deploy(request.Context(), application, nil, true) + // Use a detached context so the deployment continues even if the + // HTTP client disconnects. + deployCtx := context.WithoutCancel(request.Context()) + + deployErr := h.deploy.Deploy(deployCtx, application, nil, true) if deployErr != nil { h.log.Error("api: failed to trigger deploy", "error", deployErr) h.respondJSON(writer, request,