Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Tests expect the wait's reason in words, and room for a whole memory wait
milind-soni318071b42f31
diff --git a/server/drivers/acp/opencode-go.test.ts b/server/drivers/acp/opencode-go.test.tsindex c11dfe2cdd..02f24d1f12 100644--- a/server/drivers/acp/opencode-go.test.ts+++ b/server/drivers/acp/opencode-go.test.ts@@ -1289,7 +1289,8 @@ describe("OpenCode session variants", () => {it("is stored as a status row the person always sees", () => {const source = readFileSync(new URL("../../index.ts", import.meta.url), "utf8");const handler = source.slice(source.indexOf('case "runtime.notice":'), source.indexOf('case "runtime.error":'));- expect(handler).toContain("name: `notice: ${event.message.slice(0, 240)}`");+ // Room for a memory wait in full, Starter line included, in the longer languages.+ expect(handler).toContain("name: `notice: ${event.message.slice(0, 400)}`");});it("still switches to a model the session offers", async () => {diff --git a/server/thread-capacity-api.test.ts b/server/thread-capacity-api.test.tsindex 574e7efcf6..566dcbd6d8 100644--- a/server/thread-capacity-api.test.ts+++ b/server/thread-capacity-api.test.ts@@ -551,14 +551,16 @@ describe("per-bot thread capacity through an isolated HTTP fixture", () => {const events = await openSse(`${fixture.info.url}/api/events`);try {const queued = await send(botId, waiting, "RESTORE_AFTER_RELOAD", "reload_queue_receipt");- expect(queued.body).toMatchObject({ queued: true, reason: "capacity", threadId: waiting });- const receipt = { queueId: queued.body.queueId, text: "RESTORE_AFTER_RELOAD", reason: "capacity" };+ // The receipt says why it waits, in words a client shows as they are, on every surface that carries it.+ const why = "Queued. Starts when this bot has a free thread slot.";+ expect(queued.body).toMatchObject({ queued: true, reason: "capacity", why, threadId: waiting });+ const receipt = { queueId: queued.body.queueId, text: "RESTORE_AFTER_RELOAD", reason: "capacity", why };expect((await api("GET", "/api/bots?messages=0")).body.botQueuedMessages).toEqual({ [waiting]: [receipt] });const enqueued = await events.until((frame) => frame.kind === "bot.queued" && frame.queues[waiting]?.[0]?.queueId === receipt.queueId);expect(enqueued.queues).toEqual({ [waiting]: [receipt] });const cancelReceipt = (await send(botId, cancelled, "CANCEL_AFTER_RELOAD")).body;const restored = (await api("GET", "/api/bots")).body.botQueuedMessages;- expect(restored[cancelled]).toEqual([{ queueId: cancelReceipt.queueId, text: "CANCEL_AFTER_RELOAD", reason: "capacity" }]);+ expect(restored[cancelled]).toEqual([{ queueId: cancelReceipt.queueId, text: "CANCEL_AFTER_RELOAD", reason: "capacity", why }]);expect((await api("DELETE", `/api/bots/${botId}/queue/${restored[cancelled][0].queueId}`, { threadId: waiting })).status).toBe(404);expect((await api("DELETE", `/api/bots/${botId}/queue/${restored[cancelled][0].queueId}`, { threadId: cancelled })).status).toBe(200);const removed = await events.until((frame) => frame.kind === "bot.queued" && frame.seq > enqueued.seq + 1 && !frame.queues[cancelled]);