Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): wait for delegated Claude background wake results #24391

Closedjuliusmarmingewants to merge 3 commits intomain fromfix/issue-24297opened View on GitHub

Showing 2 changed files with 117 additions and 10 deletions.

x
0 of 2 viewed, 2 left
97 additions and 9 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -6255,7 +6255,7 @@
it.effect(
- "uses task_started as an incremental roster fallback and clears on empty snapshot",
+ "uses task_started as an incremental roster fallback and clears the internal roster on empty snapshot",
() =>
Effect.scoped(
Effect.gen(function* () {
@@ -6317,15 +6317,16 @@
- yield* Queue.offer(harness.sdkMessages, emptyRoster);
- yield* harness.until(() =>
- providerThreadRosterEvents(harness.events).some(
- (event) =>
- event.providerThread.status === "idle" &&
- (event.providerThread.pendingBackgroundTasks?.length ?? 0) === 0,
- ),
- );
+ yield* harness.offerAndWait(emptyRoster);
assert.isFalse(yield* harness.hasPendingBackgroundWork);
+ // The exited command still owes its wake run, so the published roster keeps it.
+ assert.include(
+ (
+ providerThreadRosterEvents(harness.events).at(-1)?.providerThread
+ .pendingBackgroundTasks ?? []
+ ).map((task) => task.taskId),