Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Train nov8-b: Grok lists sign-out now that #4776 adds it; the gate test answers after the client speaks

milind-sonic0b735059dc3
diff --git a/server/browser/egress/gate.test.ts b/server/browser/egress/gate.test.ts
index 7501675c1f..eff9b87ba5 100644
--- a/server/browser/egress/gate.test.ts
+++ b/server/browser/egress/gate.test.ts
@@ -210,7 +210,8 @@ describe("egress gate", () => {
});
it("reaches the next address when the first family cannot route, as autoSelectFamily was meant to", async () => {
- const reachable = NodeNet.createServer((socket) => socket.end("reached"));
+ // Answers only once the client speaks, so the answer never shares a packet with the gate's SOCKS reply.
+ const reachable = NodeNet.createServer((socket) => socket.once("data", () => socket.end("reached")));
await new Promise<void>((resolve) => reachable.listen(0, "127.0.0.1", resolve));
const reachablePort = (reachable.address() as NodeNet.AddressInfo).port;
// A mixed list is what a public name usually resolves to. The first address fails (nothing listens on ::1 at this
@@ -223,6 +224,7 @@ describe("egress gate", () => {
];
const { port } = await gate({ ...serverRules, host: "desktop" }, [], resolve);
const { code, socket } = await connectThrough(port, domainTarget("localhost", reachablePort));
+ socket.write("hello");
const answer = await new Promise<Buffer>((resolveAnswer, decline) => {
socket.once("data", resolveAnswer);
socket.once("close", () => decline(new Error("closed before an answer")));
diff --git a/server/grok-sign-in-api.test.ts b/server/grok-sign-in-api.test.ts
index d0ea47aecc..4436be9d88 100644
--- a/server/grok-sign-in-api.test.ts
+++ b/server/grok-sign-in-api.test.ts
@@ -62,7 +62,8 @@ describe.skipIf(process.platform === "win32")("Grok Build sign-in over HTTP", ()
expect(await grok()).toMatchObject({
driverKind: "grokAgent",
snapshot: { state: "available", authenticated: false },
- authentication: { method: "device-code", signOut: false },
+ // Grok signs out through its own CLI's logout, so the instance offers sign-out; Settings shows it once signed in.
+ authentication: { method: "device-code", signOut: true },
install: { signInCommand: "grok login" },
});
});