Skip to content

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

Local desktop control: keep This computer off and the macOS 13 reason on retry for older Macs

Bugfixer 21d4a88693dea
diff --git a/electron/cua-launch.test.mjs b/electron/cua-launch.test.mjs
index 577177fc4c..13d48849d6 100644
--- a/electron/cua-launch.test.mjs
+++ b/electron/cua-launch.test.mjs
@@ -1,6 +1,6 @@
import { once } from "node:events";
import { mkdtempSync, readFileSync, readdirSync, rmSync } from "node:fs";
-import { tmpdir } from "node:os";
+import os, { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
@@ -265,6 +265,23 @@ describe.skipIf(process.platform !== "darwin")("async standalone CUA launch (iso
});
});
+it("keeps the too-old-macOS reason when the person retries", async () => {
+ vi.spyOn(process, "platform", "get").mockReturnValue("darwin");
+ vi.spyOn(os, "release").mockReturnValue("21.6.0");
+ try {
+ cua.registerCuaIpc();
+ const retry = fixture.handlers.get("cua:linux-retry");
+ await expect(retry({ senderFrame: { url: "http://127.0.0.1:19777/" } })).resolves.toMatchObject({
+ enabled: false,
+ status: "error",
+ reasonCode: "macos-version-unsupported",
+ });
+ expect(fixture.hosts).toHaveLength(0);
+ } finally {
+ vi.restoreAllMocks();
+ }
+});
+
it("does not add blocking subprocess calls to Electron runtime modules", () => {
const root = dirname(fileURLToPath(import.meta.url));
// These synchronous ownership checks need separate lifecycle work: the boot ID read, the Windows creation-time query, Linux group validation.
diff --git a/electron/cua.mjs b/electron/cua.mjs
index 602c480655..fcf7635a0d 100644
--- a/electron/cua.mjs
+++ b/electron/cua.mjs
@@ -486,7 +486,7 @@ function restartCua() {
return {
enabled: ready,
status: ready ? "ready" : "error",
- reasonCode: ready ? undefined : "permissions-required",
+ reasonCode: ready ? undefined : connection?.reasonCode ?? "permissions-required",
message: connection?.reason,
};
} catch (error) {
diff --git a/src/components/MacLocalControl.tsx b/src/components/MacLocalControl.tsx
index 85b9b7369c..29c4516431 100644
--- a/src/components/MacLocalControl.tsx
+++ b/src/components/MacLocalControl.tsx
@@ -77,7 +77,6 @@ export function MacLocalControl() {
}, [awaitingGrant, hidden]);
if (capabilities.host.platform !== "darwin" || capabilities.localComputer.reasonCode === "remote-server") return null;
- // Too old a macOS: no permission or retry helps, and the computer picker already says to update.
if (capabilities.localComputer.available || hidden || capabilities.localComputer.reasonCode === "macos-version-unsupported") return null;
if (settings) {
diff --git a/src/lib/local-computer.test.ts b/src/lib/local-computer.test.ts
index 099da3bc09..2cf56b144a 100644
--- a/src/lib/local-computer.test.ts
+++ b/src/lib/local-computer.test.ts
@@ -115,6 +115,7 @@ describe("local computer UI eligibility", () => {
expect(localComputerDisabledReason({ capabilities, providerSupportsLocal: true })).toBe(
"Bots can't use this Mac: local desktop control needs macOS 13 Ventura or later. Update macOS to use it.",
);
+ expect(localComputerSelectable({ capabilities, providerSupportsLocal: true })).toBe(false);
});
it("preserves the ready local fallback on supported non-Linux hosts", () => {
diff --git a/src/lib/local-computer.ts b/src/lib/local-computer.ts
index 6c0ca1e9f8..a3f7f1fd4a 100644
--- a/src/lib/local-computer.ts
+++ b/src/lib/local-computer.ts
@@ -25,6 +25,7 @@ export function localComputerSelectable({
if (!providerSupportsLocal) return false;
if (capabilities.localComputer.available) return true;
if (pageOnRemoteServer(capabilities)) return false;
+ if (capabilities.localComputer.reasonCode === "macos-version-unsupported") return false;
return capabilities.host.platform === "darwin" || capabilities.host.platform === "win32";
}