Skip to content

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

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

koeria82b9c9d86116
diff --git a/electron/main.mjs b/electron/main.mjs
index 17472a8196..1b02913a0a 100644
--- a/electron/main.mjs
+++ b/electron/main.mjs
@@ -1179,7 +1179,14 @@ async function startServerOn(port, dataDir = runningDataDir ?? startupEnvironmen
isListening: listening.heard,
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) {