From 96f192e97a753340165f48454776550db67d07d8 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 20 Jun 2026 16:07:23 -0700 Subject: [PATCH] Preserve mixed managed endpoint diagnostics Co-authored-by: codex --- apps/server/src/cloud/ManagedEndpointRuntime.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/server/src/cloud/ManagedEndpointRuntime.ts b/apps/server/src/cloud/ManagedEndpointRuntime.ts index db9c4f9b2d..a7454178bd 100644 --- a/apps/server/src/cloud/ManagedEndpointRuntime.ts +++ b/apps/server/src/cloud/ManagedEndpointRuntime.ts @@ -88,13 +88,19 @@ function logManagedEndpointCause( attributes: Readonly>, ) { const interruptionReasons = cause.reasons.filter(Cause.isInterruptReason); - if (interruptionReasons.length > 0) { + if (interruptionReasons.length > 0 && interruptionReasons.length === cause.reasons.length) { return Effect.failCause(Cause.fromReasons(interruptionReasons)); } - return Effect.logWarning(message, { + const log = Effect.logWarning(message, { ...attributes, ...managedEndpointCauseDiagnostics(cause), }); + if (interruptionReasons.length > 0) { + return log.pipe( + Effect.andThen(Effect.failCause(Cause.fromReasons(interruptionReasons))), + ); + } + return log; } function platformErrorDiagnostics(error: PlatformError.PlatformError) {