fix(server): Claude wake runs no longer hang after a prompt joins the wake turn #27416
Closedjuliusmarmingewants to merge 1 commit into
main fromfix/claude-wake-continuation-hangopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- @@ -10412,0 +10412,21 @@10412+ }10413+ yield* Effect.gen(function* () {10414+ let framesSeen = context.wakeFrames;10415+ while (true) {10416+ yield* Effect.sleep(10417+ context.nativeWakeStarted10418+ ? CLAUDE_WAKE_TURN_IDLE_DEADLINE10419+ : CLAUDE_WAKE_TURN_START_DEADLINE,10420+ );10421+ const settled = yield* sdkMessageLock.withPermits(1)(10422+ Effect.gen(function* () {10423+ if (10424+ (yield* Ref.get(activeTurn)) !== context ||10425+ (yield* Ref.get(queryContext)) !== querySession ||10426+ querySession.stopping ||10427+ (yield* Ref.get(interruptedTurns)).has(context.providerTurnId)10428+ )10429+ return true;10430+ if (10431+ context.nativeWakeStarted &&10432+ (context.wakeFrames !== framesSeen ||
- @@ -10412,0 +10429,21 @@10429+ return true;10430+ if (10431+ context.nativeWakeStarted &&10432+ (context.wakeFrames !== framesSeen ||10433+ context.toolCalls.size > 0 ||10434+ (yield* Ref.get(pendingRuntimeRequests)).size > 0)10435+ ) {10436+ framesSeen = context.wakeFrames;10437+ return false;10438+ }10439+ yield* Effect.logWarning(10440+ context.nativeWakeStarted10441+ ? "orchestration-v2.claude-wake-turn-went-idle"10442+ : "orchestration-v2.claude-wake-turn-never-opened",10443+ {10444+ providerTurnId: context.providerTurnId,10445+ nativeThreadId,10446+ },10447+ );10448+ const completedAt = yield* DateTime.now;10449+ yield* finalizeActiveTurn({ context, status: "completed", completedAt });
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed