Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Notification routing tests: a consultation leaves its quiet line in the peer's chat

milind-sonifdded805331f
diff --git a/server/notification-routing.e2e.test.ts b/server/notification-routing.e2e.test.ts
index 8f73b95ff2..8477820a62 100644
--- a/server/notification-routing.e2e.test.ts
+++ b/server/notification-routing.e2e.test.ts
@@ -386,7 +386,8 @@ describe("bot-to-bot coordination is recorded, not announced", () => {
expect(consult.threadId).not.toBe(peer.threadId);
expect(ink.tasks.find((task: { threadId: string }) => task.threadId === consult.threadId)?.openedBy)
.toMatchObject({ botId: asker.id, kind: "work" });
- expect(ink.messages).toEqual(peerConversation);
+ // Ink's own chat only gets the hand-off's quiet line, which opens the consultation's thread.
+ expect(ink.messages).toEqual([...peerConversation, expect.objectContaining({ kind: "activity", threadRef: expect.objectContaining({ botId: peer.id, threadId: consult.threadId }) })]);
expect(current.groups.find((group: { dm?: boolean }) => group.dm === true)).toBeUndefined();
const pen = current.bots.find((candidate: { id: string }) => candidate.id === asker.id);
const replied = pen.messages.find(
@@ -529,7 +530,10 @@ describe("bot-to-bot coordination is recorded, not announced", () => {
const consult = await consultation(asked.body.receipts[0].requestId);
expect(consult.threadId).not.toBe(peer.threadId);
await expect.poll(() => handoffs().find((node) => node.id === consult.id)?.status, { timeout: 20_000 }).toBe("completed");
- expect((await botState(peer.id))?.unread).toBeFalsy();
+ // The hand-off's quiet line marks Vellum's chat unread; read it, so the mark below is the person's own message.
+ expect((await botState(peer.id))?.unread).toBe(true);
+ expect((await api("POST", `/api/bots/${peer.id}/read`, { reason: "select" })).status).toBeLessThan(300);
+ await expect.poll(async () => (await botState(peer.id))?.unread, { timeout: 10_000 }).toBeFalsy();
expect((await api("POST", `/api/bots/${peer.id}/messages`, { text: "and for me?" })).status).toBe(202);
const frame = await stream.until(
@@ -566,7 +570,10 @@ describe("bot-to-bot coordination is recorded, not announced", () => {
expect(asked.body.receipts[0]).toMatchObject({ botId: peer.id, outcome: "queued" });
const consult = await consultation(asked.body.receipts[0].requestId);
expect(consult.threadId).not.toBe(peer.threadId);
- expect((await botState(peer.id))?.unread).toBeFalsy();
+ // The hand-off's quiet line marks Folio's chat unread; read it, so the mark below is the person's own message.
+ expect((await botState(peer.id))?.unread).toBe(true);
+ expect((await api("POST", `/api/bots/${peer.id}/read`, { reason: "select" })).status).toBeLessThan(300);
+ await expect.poll(async () => (await botState(peer.id))?.unread, { timeout: 10_000 }).toBeFalsy();
expect((await api("PATCH", `/api/bots/${peer.id}`, {
modelSelection: { instanceId: "quick", model: "claude-sonnet-5" },