Skip to content

Commit 5d773a9

Browse files
committed
test(server): bind the missing-thread automation to a deleted thread
1 parent bd99541 commit 5d773a9

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,11 @@ it.effect(
412412
);
413413
return Effect.gen(function* () {
414414
const tasks = yield* ScheduledTasks.ScheduledTaskService;
415-
const threadId = ThreadId.make("thread:missing");
415+
const launches = yield* ThreadLaunch.ThreadLaunchService;
416+
const threads = yield* ThreadManagement.ThreadManagementService;
417+
const { threadId } = yield* launches.launch(
418+
launchInput({ command: "command:missing", thread: "thread:missing" }),
419+
);
416420
const { task } = yield* tasks.upsert({
417421
title: "Daily audit",
418422
prompt: "Audit performance and crashes.",
@@ -427,6 +431,11 @@ it.effect(
427431
createdBy: "user",
428432
creationSource: "web",
429433
});
434+
yield* threads.dispatch({
435+
type: "thread.delete",
436+
commandId: CommandId.make("command:missing:delete"),
437+
threadId,
438+
});
430439
const result = yield* tasks.runNow({ id: task.id });
431440
assert.equal(result.task.lastRunStatus, "failed");
432441
assert.isNull(result.threadId);

0 commit comments

Comments
 (0)