diff --git a/packages/testkit/test/autonomy.test.ts b/packages/testkit/test/autonomy.test.ts index ba64e6ac..e4d156d5 100644 --- a/packages/testkit/test/autonomy.test.ts +++ b/packages/testkit/test/autonomy.test.ts @@ -31,7 +31,9 @@ describe("autonomous cycle", () => { assert.match(review.text, /готова к ревью/); // PEP-152: the address of the result is a technical detail — under «Подробнее». assert.doesNotMatch(review.text, /pr\/7/); - assert.match((await core.messageDetails(db, [review.id])).get(review.id) ?? "", /pr\/7/); + // The details are written right after the message row appears (a separate write): wait for them. + const details = await waitFor("details of the review card", async () => (await core.messageDetails(db, [review.id])).get(review.id) || null).catch(() => ""); + assert.match(details, /pr\/7/); assert.equal(await nudges(sid), 1, "the agent was nudged once instead of pinging the PM"); assert.ok(p.log().some((e) => e.ev === "continue"), "mock continued via the Stop hook"); const qs = await db.select().from(questions).where(eq(questions.sessionId, sid));