Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Two tests wait as long as a loaded runner needs: memory capture and the Continue button
milind-soni253d3b5d144d
diff --git a/server/cloud-lending-memory.e2e.test.ts b/server/cloud-lending-memory.e2e.test.tsindex 5909b06ebf..a356a19f54 100644--- a/server/cloud-lending-memory.e2e.test.ts+++ b/server/cloud-lending-memory.e2e.test.ts@@ -14,6 +14,7 @@ import { cloudPairingSignature } from "./cloud-home.ts";import { removeTempDir, waitForExit } from "./testing/cleanup.ts";import { markLeftBehind } from "./testing/cloud-left-behind.ts";import { readHandoffs } from "./testing/handoff-rows.ts";+import { hostTimeout } from "./testing/host-timeout.ts";import { freePortBlock } from "./testing/ports.ts";const SERVER_DIR = dirname(fileURLToPath(import.meta.url));@@ -256,8 +257,9 @@ it("a conversation a guest left behind is never captured into the bot's memory;const mine = await newBot("Mine", "done");await completedTurn(() => say(owner, mine, "I like my answers short."));await settled(mine.threadId);- // Capture runs once the chat is quiet; the owner's chat proves it ran.- await expect.poll(() => memoryText(mine), { timeout: 20_000 }).toContain(INJECTED);+ // Capture runs once the chat is quiet; the owner's chat proves it ran. It is an engine run of its own, as slow as the+ // host: a shard running several files at once doubles the wait.+ await expect.poll(() => memoryText(mine), { timeout: hostTimeout(20_000) }).toContain(INJECTED);expect(await memoryText(shared)).not.toContain(INJECTED);const logs = (bot: { id: string }) => {const dir = join(home, ".openmausbot", "workspaces", bot.id, "memory", "log");@@ -265,7 +267,7 @@ it("a conversation a guest left behind is never captured into the bot's memory;};expect(logs(mine)).toContain("hello from fake claude");expect(logs(shared)).not.toContain("hello from fake claude");-}, 60_000);+}, hostTimeout(60_000));it("a turn in a conversation a guest left behind cannot write a bot's memory with its tools; the owner's own can", async () => {const bot = await newBot("Notes", "held");@@ -511,9 +513,9 @@ it("a conversation a guest left behind is never the owner's, whoever writes in iawait settled(named);const next = await completedTurn(async () => say(owner, bot, "What's next? I'm free all afternoon.", await newThread(bot)));expect(next.system).not.toContain("setup.sh");- await expect.poll(() => memoryText(bot), { timeout: 20_000 }).toContain(INJECTED);+ await expect.poll(() => memoryText(bot), { timeout: hostTimeout(20_000) }).toContain(INJECTED);expect(await memoryText(bot)).not.toContain("setup.sh");-}, 90_000);+}, hostTimeout(90_000));it("the owner's turn in a conversation a guest left behind cannot use the Mac", async () => {const bot = await newBot("Opened", "held");diff --git a/src/components/limit-resets.test.ts b/src/components/limit-resets.test.tsindex a0ecfcd3e8..3f3a1d34a1 100644--- a/src/components/limit-resets.test.ts+++ b/src/components/limit-resets.test.ts@@ -258,8 +258,8 @@ describe("the chat", () => {await settle();expect(fixture.api).toHaveBeenCalledWith("/api/limit-resets/continue", { method: "POST", body: JSON.stringify({ botId: "scout", threadId: "t-1" }) });expect(fixture.dispatch).toHaveBeenCalledWith({ type: "routinePatched", routine: created });- flushSync(() => {});- expect(container.textContent).not.toContain("Continue at");+ // The button goes once React renders the update its answer set, which a busy runner can schedule after any one tick.+ await vi.waitFor(() => expect(container.textContent).not.toContain("Continue at"));});it("offers Retry as before once the reset has passed, or when the engine named no reset", () => {