🐭
Couldn't start the bot server
Something else is using its ports. Quit and reopen OpenMausBot — if it keeps happening, restart your computer.
`,
+function syncManagedComposioCredentials() {
+ if (!serverProc) return;
+ try {
+ serverProc.postMessage({
+ type: "openmausbot:managed-composio",
+ access: managedComposioAccess(composioBrokerUrl(), secureCredentials),
+ });
+ } catch (error) {
+ slog(`connected-apps credential sync failed: ${error?.message ?? error}`);
+ }
+}
+
+// The page is built at failure time (not import time): the message depends on
+// how the boot failed, and the log path comes from LOG_DIR so Windows and
+// Linux users see their real location instead of a macOS guess. The link
+// opens the log through the window's setWindowOpenHandler, which routes to
+// the platform handler.
+function escapeHtml(value) {
+ return value.replace(/[&<>"']/g, (ch) => `${ch.charCodeAt(0)};`);
+}
+
+function buildErrorPage({ allPortsOccupied }) {
+ const serverLogPath = path.join(LOG_DIR, "server.log");
+ const serverLogHref = pathToFileURL(serverLogPath).href;
+ const reason = allPortsOccupied
+ ? "Every OpenMausBot port answered health checks from another process — likely a second copy of the app, or another program on ports 8799–28799. Quit that program, then quit and reopen OpenMausBot."
+ : "The background server didn't come up in time — this is usually slow startup, not a port conflict. Quit and reopen OpenMausBot.";
+ return (
+ "data:text/html;charset=utf-8," +
+ encodeURIComponent(
+ `