Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
test(grok): a server that fails to list fails the parity check; the fake holds only the session's own MCP children
milind-soni41ca16146d43
diff --git a/server/grok-own-mcp-http.e2e.test.ts b/server/grok-own-mcp-http.e2e.test.tsindex 922499659c..fcea200cc1 100644--- a/server/grok-own-mcp-http.e2e.test.ts+++ b/server/grok-own-mcp-http.e2e.test.ts@@ -65,6 +65,9 @@ it("gives a Grok turn OpenMausBot's own tools by URL, no proxy process each, eveconst own = sent.filter((server) => server.type === "http");expect(own.map((server) => server.name).sort()).toEqual(stdioSent.filter(ownProxy).map((server) => server.name).sort());for (const server of own) expect(server.url).toBe(`${url}/api/internal/mcp-http/${server.name}`);+ // A server that failed to list shows as "<name> failed" in both, which a comparison by name alone would miss.+ expect(Object.keys(overStdio).sort()).toEqual(stdioSent.map((server) => server.name).sort());+ expect(Object.keys(overUrl).sort()).toEqual(sent.map((server) => server.name).sort());for (const server of own) expect(overUrl[server.name], server.name).toEqual(overStdio[server.name]);expect(overUrl.agents).toEqual(expect.arrayContaining(["list_bots"]));expect(overUrl.data).toEqual(expect.arrayContaining(["data_sql"]));diff --git a/server/testing/fake-acp-cli.ts b/server/testing/fake-acp-cli.tsindex 765c5ca814..7288d23af1 100755--- a/server/testing/fake-acp-cli.ts+++ b/server/testing/fake-acp-cli.ts@@ -573,10 +573,10 @@ const heldMcp = new Set<ReturnType<typeof spawn>>();process.once("exit", () => { for (const child of heldMcp) child.kill(); });function holdSessionMcp(): void {if (process.env.FAKE_ACP_MCP_HOLD !== "1") return;- for (const entry of sessionMcp) void listMcpTools(entry, GROK_MCP_HANDSHAKE).catch(() => {});+ for (const entry of sessionMcp) void listMcpTools(entry, GROK_MCP_HANDSHAKE, true).catch(() => {});}-async function listMcpTools(entry: AnyMcpEntry, handshake: unknown): Promise<string[]> {+async function listMcpTools(entry: AnyMcpEntry, handshake: unknown, hold = false): Promise<string[]> {const names = (result: any) => (result?.tools ?? []).map((tool: { name: string; inputSchema?: unknown }) =>process.env.FAKE_ACP_MCP_SCHEMA_BYTES === "1" ? `${tool.name}=${JSON.stringify(tool.inputSchema ?? {}).length}` : tool.name);if (typeof entry.url === "string") {@@ -587,7 +587,6 @@ async function listMcpTools(entry: AnyMcpEntry, handshake: unknown): Promise<strconst env = { ...process.env };for (const { name, value } of entry.env ?? []) env[name] = value;const child = spawn(entry.command!, entry.args ?? [], { env, stdio: ["pipe", "pipe", "ignore"] });- const hold = process.env.FAKE_ACP_MCP_HOLD === "1";if (hold) heldMcp.add(child);const finish = (error: Error | null, tools?: string[]) => { clearTimeout(timer); if (!hold || error) child.kill(); if (error) reject(error); else resolve(tools!); };const timer = setTimeout(() => finish(new Error("mcp timeout")), 20_000);