Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Isolate host claim fixtures and wait for room turn evidence
Local contributor05b260bfc283
diff --git a/server/host-lazy-claim.e2e.test.ts b/server/host-lazy-claim.e2e.test.tsindex 7b5e327f21..db3e77f4ca 100644--- a/server/host-lazy-claim.e2e.test.ts+++ b/server/host-lazy-claim.e2e.test.ts@@ -3,7 +3,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSyncimport { tmpdir } from "node:os";import { dirname, join } from "node:path";import { fileURLToPath, pathToFileURL } from "node:url";-import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest";+import { afterAll, afterEach, beforeEach, describe, expect, it } from "vitest";import { writeFileAtomic } from "./atomic.ts";import { CONTROL_BUSY, CONTROL_HANDED_BACK, CONTROL_REFUSAL_PLAIN, CONTROL_WAITED, controlRefusal, createControlClient } from "./control-client.ts";import { computerPersonAwayText } from "./computer-wait.ts";@@ -116,7 +116,7 @@ describe("lazy host claim and pin on use (issue #1650)", () => {// Full access, the default, is the person's grant to use this computer without asking; every other level asks.const ASKS = "ask";- beforeAll(async () => {+ beforeEach(async () => {home = mkdtempSync(join(tmpdir(), "omb-host-lazy-claim-"));data = join(home, "data");ui = join(home, "static");@@ -142,7 +142,11 @@ describe("lazy host claim and pin on use (issue #1650)", () => {await stop();if (home) await removeTempDir(home);});- afterEach(async () => { await stop(); resetTurn(); });+ afterEach(async () => {+ await stop();+ if (home) await removeTempDir(home);+ home = "";+ });itAutoHost("never offers a computer to a call through the Bot API, on Auto, on this computer or on a private desktop", async () => {await start({ FAKE_CLAUDE_VERSION: "2.1.284" });diff --git a/server/room-pages-point.e2e.test.ts b/server/room-pages-point.e2e.test.tsindex 80b9cbd8f9..c0c59c8df8 100644--- a/server/room-pages-point.e2e.test.ts+++ b/server/room-pages-point.e2e.test.ts@@ -101,9 +101,11 @@ it("sends a pick on a room page to the bot that made it, and to no other member"// A line pointing at two bots' pages whose round stops during the first bot's turn reports the other bot's part.expect((await api(`/api/groups/${group.id}/holds`, { botId: designer.id, held: false })).status).toBeLessThan(300);writeFileSync(planPath, JSON.stringify({ [designer.id]: { steps: [], reply: "Done." }, [helper.id]: { steps: [{ tool: "show_html", arguments: { html: "<main><p>Notes</p></main>", title: "Notes" } }], reply: "Done." } }));+ const notesTurns = evidence(helper.id).length;expect((await api(`/api/groups/${group.id}/messages`, { text: "@Helper make a notes page", mentions: [helper.id] })).status).toBe(202);await expect.poll(async () => (await transcript()).find((message) => message.kind === "app" && message.from?.botId === helper.id)?.id, { timeout: 30_000 }).toBeTruthy();await settled(helper.id);+ await expect.poll(() => evidence(helper.id).length, { timeout: 30_000 }).toBe(notesTurns + 1);const notes = (await transcript()).find((message) => message.kind === "app" && message.from?.botId === helper.id);const designerReady = join(fixture.info.dataDir, "designer-ready");writeFileSync(planPath, JSON.stringify({ [designer.id]: { steps: [], reply: "Done.", readyFile: designerReady, gateFile: join(fixture.info.dataDir, "designer-gate") }, [helper.id]: { steps: [], reply: "Done." } }));