Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(claude): a background-task wake run no longer hangs after a user turn absorbed its wake #28010

Mergedmaria-rcksmerged 1 commit intomain fromrefs/pull/28010/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 108 additions and 1 deletion.

x
0 of 2 viewed, 2 left
80 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -11432,6 +11432,86 @@
+ it.effect("settles a continuation whose wake turn a user turn absorbed", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const harness = yield* makeWakeHarness;
+ const now = yield* DateTime.now;
+​
+ yield* harness.runtime.startTurn(
+ makeClaudeTestTurnInput({
+ threadId: harness.threadId,
+ providerThread: harness.providerThread,
+ now,
+ attemptId: RunAttemptId.make("attempt-claude-wake-absorbed-1"),
+ text: "Run the build in the background.",
+ attachments: [],
+ }),
+ );
+ yield* Queue.offer(harness.sdkMessages, wakeTaskStarted);
+ yield* Queue.offer(harness.sdkMessages, wakeNotification);
+ yield* Queue.offer(harness.sdkMessages, turnOneResult);
+ yield* harness.awaitTerminal(1);
+ yield* harness.offerAndWait(wakeTurnInit);
+ yield* harness.offerAndWait(wakeAssistant);
+ yield* harness.awaitContinuation(1);
+​
+ // Claude folds this prompt into the wake turn it already opened, so one result ends both.
+ yield* harness.runtime.startTurn(