From ae48a8590753c780826a1ea13dc04e7c53e71245 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 17 Mar 2026 00:34:13 +0000 Subject: [PATCH] Fix: re-propagate interrupt causes in sendTurnForThread catchCause handler The inner Effect.catchCause around sendTurnForThread was unconditionally catching all causes, including interrupts. During shutdown or fiber cancellation, this would create a spurious provider.turn.start.failed activity and swallow the interrupt signal before the outer processDomainEventSafely handler could re-propagate it. Add a Cause.hasInterruptsOnly check (matching the pattern used elsewhere in the codebase) to re-fail with the cause when it is interrupt-only. Co-authored-by: Julius Marminge --- .../orchestration/Layers/ProviderCommandReactor.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts index 38d0b7bbd..378f4a0b3 100644 --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts @@ -498,16 +498,19 @@ const make = Effect.gen(function* () { interactionMode: event.payload.interactionMode, createdAt: event.payload.createdAt, }).pipe( - Effect.catchCause((cause) => - appendProviderFailureActivity({ + Effect.catchCause((cause) => { + if (Cause.hasInterruptsOnly(cause)) { + return Effect.failCause(cause); + } + return appendProviderFailureActivity({ threadId: event.payload.threadId, kind: "provider.turn.start.failed", summary: "Provider turn start failed", detail: Cause.pretty(cause), turnId: null, createdAt: event.payload.createdAt, - }), - ), + }); + }), ); });