Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): stopping a Claude turn no longer hangs without an acknowledgement #16419

Mergedyaacovcorcos(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/16419/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 121 additions and 1 deletion.

x
0 of 2 viewed, 2 left
120 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -8722,6 +8722,126 @@
+ it.effect("lets the native SDK acknowledge Stop before closing its own query", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ let closes = 0;
+ let acknowledge = Effect.void;
+ const harness = yield* makeWakeHarnessWithOptions({
+ interrupt: Effect.suspend(() => {
+ assert.equal(closes, 0);
+ return acknowledge;
+ }),
+ close: (messages) =>
+ Effect.sync(() => {
+ closes++;
+ }).pipe(Effect.andThen(Queue.shutdown(messages))),
+ });
+ yield* harness.runtime.startTurn(
+ makeClaudeTestTurnInput({
+ threadId: harness.threadId,
+ providerThread: harness.providerThread,
+ now: yield* DateTime.now,
+ attemptId: RunAttemptId.make("graceful-stop"),
+ text: "Work until stopped",
+ attachments: [],
+ }),
+ );
+ acknowledge = harness.offerAndWait(