From 35d1f923e9c10d3f0d7b6b2e86f78492d72371d8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 23:45:43 +0000 Subject: [PATCH] test: look up the home main conversation in the scheduling journey Since every project has its own main conversation, the journey that schedules for a specialist found the user's main conversation with findFirst over all of them. With the Lab project's conversation also matching, it picked either one, so the check failed about one run in three. The lookup now names the home space, where the specialist joined and the routine is created. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01MRtGG9ARfqqhma3t85Ro2u --- packages/testkit/src/journeys.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/testkit/src/journeys.test.ts b/packages/testkit/src/journeys.test.ts index f5ae027..d6d8d98 100644 --- a/packages/testkit/src/journeys.test.ts +++ b/packages/testkit/src/journeys.test.ts @@ -1301,8 +1301,9 @@ describeJourneys("required product journeys", () => { }); await joinMainConversation(prisma, { userId: me.userId, botIds: [writer.id] }); + // Lab has a main conversation of its own; the home one is where Writer joined. const conversation = await prisma.chatGroup.findFirstOrThrow({ - where: { userId: me.userId, kind: "main" }, + where: { userId: me.userId, spaceId: main.spaceId, kind: "main" }, include: { thread: true }, }); const inMain = await scheduleAndWake("Writer", "main-digest");