fix(registry): log boot Register HTTP response code on non-200 (#2500) #2563

Merged
agent-reviewer-cr2 merged 1 commits from fix/2500-register-boot-logging into main 2026-06-11 01:32:53 +00:00
@@ -331,6 +331,17 @@ func (h *RegistryHandler) Register(c *gin.Context) {
return
}
// #2500 instrumentation: log non-200 boot Register outcomes so operators
// can distinguish 401 (C18 token race), 400 (push-URL invalid/empty),
// 403 (platform kind guard), 5xx (DB/internal error), or success from
// client timeout / unreachable $PLATFORM_URL.
registerStart := time.Now()
defer func(wsID string) {
if status := c.Writer.Status(); status != http.StatusOK {
log.Printf("Registry register: workspace=%s boot_register_failed status=%d duration=%s", wsID, status, time.Since(registerStart))
}
}(payload.ID)
// Validate explicit delivery_mode if the agent declared one; empty is
// allowed and resolves to the row's existing value (or "push" default)
// in the upsert below. See #2339 for the poll/push split rationale.