Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): stop both completion-wake task cohorts #15331

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

Showing 2 changed files with 156 additions and 8 deletions.

x
0 of 2 viewed, 2 left
146 additions and 0 deletionsapps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.tsModified
View file
@@ -293,6 +293,152 @@
});
​
it.layer(layerTest)("delegated completion delivery repairs", (it) => {
+ it.effect(
+ "interrupting a completion wake disposes both cohorts without reviving them on late results",
+ () =>
+ Effect.gen(function* () {
+ const orchestrator = yield* Orchestrator.OrchestratorV2;
+ const sink = yield* EventSink.EventSinkV2;
+ const now = yield* DateTime.now;
+ const threadId = ThreadId.make("stop-wake-parent");
+ const originRunId = RunId.make("stop-wake-origin");
+ const incomingTaskId = NodeId.make("stop-wake-incoming");
+ yield* seedParentWithTerminalTask({
+ threadId,
+ projectId: ProjectId.make("stop-wake-project"),
+ runId: originRunId,
+ rootNodeId: NodeId.make("stop-wake-origin-root"),
+ taskId: incomingTaskId,
+ deliveryState: "claimed",
+ deliveryTaskIds: [incomingTaskId],
+ completionWake: "always",
+ now,
+ });
+ const origin = (yield* orchestrator.getThreadProjection(threadId)).runs[0]!;
+ yield* sink.write({
+ events: [
+ {
+ ...runEvent({ threadId, runId: originRunId, ordinal: 1, status: "completed", now }),