Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Tests: step the clock to each reconnect in the socket fallback test
milind-sonicd06102e6744
diff --git a/src/lib/live-events.test.ts b/src/lib/live-events.test.tsindex a1bf1172ef..2d9b02d674 100644--- a/src/lib/live-events.test.ts+++ b/src/lib/live-events.test.ts@@ -674,12 +674,14 @@ describe("the WebSocket feed", () => {h.sockets[0]!.message({ kind: "hello", cursor: "epoch:1", resumed: false });await Promise.resolve();h.sockets[0]!.error();+ const opened = () => h.sockets.length + h.sources.length;for (let attempt = 1; attempt <= 3; attempt++) {- vi.advanceTimersByTime(10_000);+ for (let waited = 0; opened() < attempt + 1 && waited < 20_000; waited += 100) vi.advanceTimersByTime(100);expect(h.sockets).toHaveLength(attempt + 1);+ expect(h.sources).toHaveLength(0);h.sockets[attempt]!.error();}- vi.advanceTimersByTime(10_000);+ for (let waited = 0; opened() < 5 && waited < 20_000; waited += 100) vi.advanceTimersByTime(100);expect(h.sockets).toHaveLength(4);expect(h.sources).toHaveLength(1);stop();