Skip to content

Fix: re-propagate interrupt causes in sendTurnForThread catchCause handler#1155

Draft
cursor[bot] wants to merge 1 commit intocodething/648ca884-claudefrom
cursor/provider-turn-interrupt-handling-a740
Draft

Fix: re-propagate interrupt causes in sendTurnForThread catchCause handler#1155
cursor[bot] wants to merge 1 commit intocodething/648ca884-claudefrom
cursor/provider-turn-interrupt-handling-a740

Conversation

@cursor
Copy link
Contributor

@cursor cursor bot commented Mar 17, 2026

Problem

The inner Effect.catchCause wrapper around sendTurnForThread in ProviderCommandReactor.ts unconditionally caught all causes, including interrupts. During shutdown or fiber cancellation, this would:

  1. Create a spurious provider.turn.start.failed activity
  2. Attempt to dispatch a command to the possibly-shutting-down orchestration engine
  3. Swallow the interrupt signal before the outer processDomainEventSafely handler could re-propagate it

Fix

Added a Cause.hasInterruptsOnly(cause) check in the inner handler (matching the pattern used in processDomainEventSafely and elsewhere in the codebase) to re-fail with the cause when it is interrupt-only, allowing proper interrupt propagation.

Open in Web Open in Cursor 

Note

Re-propagate interrupt causes in sendTurnForThread catchCause handler

In ProviderCommandReactor.ts, the catchCause handler for provider turn start now checks Cause.hasInterruptsOnly(cause) and re-fails with Effect.failCause(cause) instead of recording a provider.turn.start.failed activity. Non-interrupt failures continue to produce the failure activity as before.

Macroscope summarized ae48a85.

…ndler

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 <juliusmarminge@users.noreply.github.com>
@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant