Skip to content

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

Wait for the automatic title to settle before manual regeneration

skygunnercc4cd803026e
diff --git a/server/thread-title-regenerate.e2e.test.ts b/server/thread-title-regenerate.e2e.test.ts
index f93e4d3349..5fac8b8593 100644
--- a/server/thread-title-regenerate.e2e.test.ts
+++ b/server/thread-title-regenerate.e2e.test.ts
@@ -1,5 +1,5 @@
import { spawn, type ChildProcess } from "node:child_process";
-import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
+import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
@@ -100,7 +100,7 @@ describe("Regenerate title", { timeout: 60_000 }, () => {
botId = bot.id;
// background memory capture is a one-shot too; keep it off this dump
expect((await api("PATCH", `/api/bots/${botId}`, { memoryUpkeep: false })).status).toBe(200);
- rmSync(titleFile, { force: true });
+ writeFileSync(titleFile, "Initial login investigation");
const sent = await api("POST", `/api/bots/${botId}/messages`, { text: "every login hangs after the session expires" });
expect(sent.status).toBe(202);
threadId = sent.body.threadId;
@@ -109,7 +109,7 @@ describe("Regenerate title", { timeout: 60_000 }, () => {
const current = (await api("GET", "/api/bots?messages=0")).body.bots.find((candidate: { id: string }) => candidate.id === botId);
return !current?.busy && (page?.messages ?? []).some((message: { role: string; kind: string }) => message.role === "bot" && message.kind === "text");
}, { timeout: 20_000, interval: 150 }).toBe(true);
- await expect.poll(() => existsSync(titleDump), { timeout: 10_000 }).toBe(true);
+ await expect.poll(() => taskTitle(botId, threadId), { timeout: 10_000 }).toBe("Initial login investigation");
rmSync(titleDump, { force: true });
expect((await api("PATCH", `/api/bots/${botId}/tasks/${threadId}`, { title: "My name for it" })).status).toBe(200);