Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a send no longer bounces while the previous session runs background work #36397

Openjuliusmarmingewants to merge 7 commits intomain fromrefs/pull/36397/headopened View on GitHub

Showing 10 changed files with 36 additions and 8 deletions (loading 8).

x
0 of 10 viewed, 10 left
18 additions and 7 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -11063,7 +11063,7 @@
it.effect(
- "uses task_started as an incremental roster fallback, keeps its tool call, and clears internal work on empty snapshot",
+ "uses task_started as an incremental roster fallback and still owes its wake after an empty snapshot",
Effect.gen(function* () {
const harness = yield* makeWakeHarness;
@@ -11211,7 +11211,7 @@
).map((task) => task.taskId),
WAKE_TASK_ID,
- assert.isFalse(yield* harness.hasPendingBackgroundWork);
+ assert.isTrue(yield* harness.hasPendingBackgroundWork);
}).pipe(
Effect.provide(
Layer.mergeAll(
@@ -13937,9 +13937,20 @@
assert.isTrue(yield* harness.hasPendingBackgroundWork);
assert.lengthOf(harness.continuationRequests, 0);
+ // Claude may empty the roster before the notification; the session still owes the wake.
+ yield* harness.offerAndWait(
+ claudeSdkFrame({
+ type: "system",
+ subtype: "background_tasks_changed",
+ tasks: [],