Skip to content

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

test: assert each held hand-off is noted once by id; drop history comment

Bugfixer 2ee4cf023534d
diff --git a/server/host/wait-words.test.ts b/server/host/wait-words.test.ts
index e8f4f053f6..822a20d7b3 100644
--- a/server/host/wait-words.test.ts
+++ b/server/host/wait-words.test.ts
@@ -74,9 +74,10 @@ describe("a hand-off held a while", () => {
it("says it once for each of several hand-offs held behind the same turn, however often the queue is checked", () => {
const held = ["r1", "r2", "q"].map((id) => ({ ...node, id, status: id === "q" ? "queued" : "resume" }) as HandoffView);
- const { note, posted } = notes({ threadBusy: () => true, node: (id) => held.find((n) => n.id === id) });
+ const posted: string[] = [];
+ const { note } = notes({ threadBusy: () => true, node: (id) => held.find((n) => n.id === id), post: (_p, n) => posted.push(n.id) });
for (let tick = 0; tick < 4; tick++) for (const n of held) note(n);
- expect(posted).toHaveLength(3);
+ expect(posted).toEqual(["r1", "r2", "q"]);
});
it("stays quiet for a short hold, a room's own hand-off, a computer's wait and a person's open card, which say so themselves", () => {
diff --git a/server/host/wait-words.ts b/server/host/wait-words.ts
index 8a3a7e24d6..77d68bfdca 100644
--- a/server/host/wait-words.ts
+++ b/server/host/wait-words.ts
@@ -44,8 +44,6 @@ export interface QueuedNotesDeps extends Pick<QueuedReasonDeps, "botName" | "thr
node(id: string): HandoffView | undefined;
}
-/** The runtime holds a resuming hand-off behind a busy turn too: counting only "queued" as still held let two such
- * hand-offs prune each other's note and post it again on every check. */
const stillHeld = (node: HandoffView | undefined): boolean => node?.status === "queued" || node?.status === "resume";
/** One line in the requester's chat once a hand-off has been held a while, naming the limit. A computer's wait and a person's