Skip to content

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

Merge #7935: fix(desktop): re-send the mutation token once the server reports ready

milind-sonid9dbc58edb98
diff --cc electron/main.mjs
index 8560213927,b33c4d1224..e125c4bc02
--- a/electron/main.mjs
+++ b/electron/main.mjs
@@@ -1176,10 -1168,17 +1168,17 @@@ async function startServerOn(port, data
pid: () => proc.pid,
bootTimeoutMs: SERVER_BOOT_TIMEOUT_MS,
isExited: () => exited || desktopShutdownStarted,
- isListening: listening.heard,
+ isListening: listening.heard, listened: listening.announced,
listeningGraceMs: SERVER_LISTENING_GRACE_MS,
});
- if (identity.outcome === "ready" && serverSupervisor.isCurrent(proc)) return { proc };
+ // The spawn-time post races the server child's listener registration (the child attaches its
+ // private-message listener only after its module has finished loading). Re-post the capability
+ // once the server reports ready; applying it is idempotent, and a token is required before the
+ // desktop window can sign in locally.
+ if (identity.outcome === "ready" && serverSupervisor.isCurrent(proc)) {
+ syncDesktopMutationToken(proc);
+ return { proc };
+ }
slog(bootFailureMessage(port, identity));
const stopped = await stopUtilityServer(proc);
if (!stopped) {