Skip to content

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

fix(settings): restore VPS selection for existing bots

leonongoing41c442d3f126
diff --git a/docs/verification/evidence/vps-backend-selector/after.png b/docs/verification/evidence/vps-backend-selector/after.png
new file mode 100644
index 0000000000..cd877ec681
Binary files /dev/null and b/docs/verification/evidence/vps-backend-selector/after.png differ
diff --git a/docs/verification/evidence/vps-backend-selector/before.png b/docs/verification/evidence/vps-backend-selector/before.png
new file mode 100644
index 0000000000..33c6274198
Binary files /dev/null and b/docs/verification/evidence/vps-backend-selector/before.png differ
diff --git a/src/components/BotSettingsDialog.simple.test.ts b/src/components/BotSettingsDialog.simple.test.ts
index 0a7f488448..54f17c2782 100644
--- a/src/components/BotSettingsDialog.simple.test.ts
+++ b/src/components/BotSettingsDialog.simple.test.ts
@@ -129,6 +129,8 @@ const { SettingsPage } = await import("./bot-panel/SettingsPage");
const { LibraryTab } = await import("./bot-panel/LibraryTab");
const { ApprovalChip } = await import("./ComposerPlusMenu");
const { callMode, setCallMode } = await import("@/lib/call-mode");
+const { CloudBackendPicker } = await import("./CloudBackendPicker");
+const { CloudPreference } = await import("./bot-settings/AccessSection");
const { ComputerTab, WherePage } = await import("./bot-panel/ComputerTab");
const { PageBody, AppsPage, RoutinesPage, MemoryPage, SkillsPage, FolderPage, BrowserPage } = await import("./bot-panel/pages");
const { BrowserLogins } = await import("./bot-panel/browser-logins");
@@ -981,6 +983,29 @@ describe("the Where it works page", () => {
.map((node) => [node.props["data-panel-choice"], node.props.title, Boolean(node.props.disabled), node.props.checked]);
const choose = (rendered: Rendered, value: string) => click(find(rendered, "data-panel-choice", value));
+ it.each([undefined, "cloud"] as const)("offers the hosted desktop backend for an existing bot kept on %s", (computer) => {
+ fixture.storeState = { ...fixture.storeState, config: { vps: { sshAlias: "fixture-vps" } } };
+ const bot = makeBot({ computer, cloudBackend: "box" });
+ const preference = ofType(where(bot), CloudPreference);
+ expect(preference).toBeDefined();
+ expect(preference!.props).toMatchObject({ bot, patch });
+ expect(where(bot).html).toContain("Self-hosted VPS");
+ const picker = ofType(capture(() => CloudPreference({ bot, patch })), CloudBackendPicker)!;
+ (picker.props.onChange as (backend: string) => void)("vps");
+ expect(patch).toHaveBeenLastCalledWith({ cloudBackend: "vps" });
+ (picker.props.onChange as (backend: string) => void)("box");
+ expect(patch).toHaveBeenLastCalledWith({ cloudBackend: "box" });
+ });
+
+ it.each(["local", "browser", "vm", "off"] as const)("does not offer a hosted backend for a bot kept on %s", (computer) => {
+ expect(where(makeBot({ computer })).html).not.toContain("Self-hosted VPS");
+ });
+
+ it("does not offer a hosted backend on a Cloud home", () => {
+ fixture.storeState = { ...fixture.storeState, config: { cloudHome: true } };
+ expect(where(makeBot()).html).not.toContain("Self-hosted VPS");
+ });
+
it("offers Let it choose, this computer, the bot's browser, the Cloud desktop and the private desktop, with the chosen one checked", () => {
// The tests run on no platform in particular, so this computer is a PC; a Mac says This Mac.
expect(choices(where(makeBot()))).toEqual([
diff --git a/src/components/bot-panel/ComputerTab.tsx b/src/components/bot-panel/ComputerTab.tsx
index a3fe19942b..7b2b89f722 100644
--- a/src/components/bot-panel/ComputerTab.tsx
+++ b/src/components/bot-panel/ComputerTab.tsx
@@ -12,6 +12,7 @@ import { useDesktopCapabilities } from "../DesktopCapabilities";
import { LocalComputerAutoWarning } from "../LocalComputerAutoWarning";
import { usePlaceViews } from "../PlaceChip";
import { screenFramePreview } from "../ScreenFrame";
+import { CloudPreference } from "../bot-settings/AccessSection";
import type { BotPatch, useBotSettingsDerived } from "../bot-settings/useBotSettingsDerived";
import type { SimplePageId } from "./page-registry";
import { Card, NavRow, RadioRow } from "./rows";
@@ -111,6 +112,7 @@ export function WherePage({ bot, derived }: { bot: Bot; derived: Derived }) {
))}
</div>
</Card>
+ <CloudPreference bot={bot} patch={patch} />
{usingNow && <p data-panel-using-now className="mx-1 text-[13px] text-ink-secondary">{t("computer.simple.usingNow", { place: usingNow })}</p>}
<LocalComputerAutoWarning
open={localAutoWarning !== null}