Skip to content

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

Prove the busy-in line on the isolated fixture

Bugfixer 2c8e8ebfd4687
diff --git a/docs/verification/room-coordination.md b/docs/verification/room-coordination.md
index 29b91732ab..2a7dccfda3 100644
--- a/docs/verification/room-coordination.md
+++ b/docs/verification/room-coordination.md
@@ -238,6 +238,15 @@ members work in one room, holds the first on a gate, and checks the Lead's
receipts and the room's `group` frames (2 of 3 and 3 of 3, both waiting on
the first), then that the line clears once all three settle.
+A member already running elsewhere is named: while it speaks in another
+room (or works in a busy thread of its own), its queued job here carries
+`busyIn` and the room shows "Busy in <room> · queued …" ("another
+conversation" when the viewer can't see that room).
+
+```sh
+pnpm exec vitest run server/room-queue.e2e.test.ts -t "names the other room"
+```
+
### Parallel room jobs (opt-in)
With `features.parallelRoomJobs` on (`PATCH /api/config` with
diff --git a/server/room-queue.e2e.test.ts b/server/room-queue.e2e.test.ts
index 4013bd252c..d9a39f491b 100644
--- a/server/room-queue.e2e.test.ts
+++ b/server/room-queue.e2e.test.ts
@@ -159,3 +159,42 @@ it("with parallel room jobs on, runs each member's job in its own thread at once
await session.close();
}
}, 120_000);
+
+it("names the other room a queued member is busy in", async () => {
+ const session = await launchVerificationServer(process.env, undefined, undefined, undefined, undefined, { scripted: true });
+ const env = { OPENMAUSBOT_URL: session.info.url };
+ const cli = (...args: string[]) => runControlOmb(args, { env }) as Promise<any>;
+ const tool = (name: string, args: Record<string, unknown>) => handleToolCall(name, args, (path, options) => request(path, options, session.info.url)) as Promise<any>;
+ const events = await openSse(`${session.info.url}/api/events`, { Origin: session.info.url });
+ try {
+ const lead = (await cli("new-bot", "--name", "Lead", "--section", "A")).bot;
+ const worker = (await cli("new-bot", "--name", "Worker", "--section", "A")).bot;
+ const lab = (await tool("create_channel", { name: "Lab", member_ids: [worker.id] })).channel;
+ const studio = (await tool("create_channel", { name: "Studio", member_ids: [lead.id, worker.id] })).channel;
+ const planPath = join(session.info.dataDir, "room-plan.json");
+ const gate = join(session.info.dataDir, "worker.gate");
+ const ready = join(session.info.dataDir, "worker.ready");
+ writeFileSync(planPath, JSON.stringify({
+ [lead.id]: { steps: [{ arguments: { bot_ids: [worker.id], message: "Cut the trailer" } }], reply: "Assigned", resumeReply: "Trailer reviewed" },
+ [worker.id]: { reply: "Done here", gateFile: gate, readyFile: ready },
+ }));
+ // Worker starts a long turn in Lab, then the Lead in Studio hands it a job.
+ await cli("send-channel", "--channel", lab.id, "--text", "@Worker check the footage");
+ await expect.poll(() => existsSync(ready), { timeout: 30_000 }).toBe(true);
+ await cli("send-channel", "--channel", studio.id, "--text", "@Lead Get the trailer cut");
+
+ // Studio's line names Lab as where Worker is busy, not just "queued".
+ const frame = await events.until(f => f.kind === "group" && f.group?.id === studio.id &&
+ (f.group.queue ?? []).some((e: any) => e.botId === worker.id && e.state === "queued"), 30_000);
+ const entry = frame.group.queue.find((e: any) => e.botId === worker.id);
+ expect(entry.busyIn).toEqual({ groupId: lab.id, threadId: expect.any(String) });
+ expect(entry.busyIn.threadId).not.toBe(frame.group.threadId);
+
+ writeFileSync(gate, "release");
+ expect((await cli("wait", "--channel", studio.id, "--timeout", "60")).status).toBe("settled");
+ await events.until(f => f.kind === "group" && f.group?.id === studio.id && Array.isArray(f.group.queue) && f.group.queue.length === 0, 15_000);
+ } finally {
+ events.close();
+ await session.close();
+ }
+}, 120_000);