Skip to content

Commit a8ebd72

Browse files
committed
test(orchestration): assert successor wake is dispatched on open cohort sibling preservation
1 parent 331ffff commit a8ebd72

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,32 @@ it.layer(layerTest)("delegated completion delivery repairs", (it) => {
542542
const sibling = projection.subagents.find((task) => task.id === siblingTaskId)!;
543543
assert.equal(sibling.completionDelivery?.state, "claimed");
544544
assert.deepEqual(parentRun.delegatedCompletion?.delivery?.taskIds, [siblingTaskId]);
545+
546+
const successorDelivery = parentRun.delegatedCompletion!.delivery!;
547+
yield* orchestrator.dispatch({
548+
type: "message.dispatch",
549+
createdBy: "agent",
550+
creationSource: "server",
551+
commandId: CommandId.make("open-cohort-successor-wake-start"),
552+
threadId,
553+
messageId: successorDelivery.messageId,
554+
text: "Delegated task completed",
555+
attachments: [],
556+
modelSelection,
557+
dispatchMode: { type: "queue_after_active" },
558+
delegatedCompletion: {
559+
parentRunId: originRunId,
560+
generation: successorDelivery.generation,
561+
taskIds: successorDelivery.taskIds,
562+
},
563+
});
564+
yield* orchestrator.resumeQueuedRuns;
565+
566+
const successorRun = (yield* orchestrator.getThreadProjection(threadId)).runs.find(
567+
(run) => run.userMessageId === successorDelivery.messageId,
568+
)!;
569+
assert.isDefined(successorRun);
570+
assert.equal(successorRun.status, "starting");
545571
}),
546572
);
547573

0 commit comments

Comments
 (0)