Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c721f45
API: moving to OpenBot Cloud (export, import, verify)
davidmckayv Nov 21, 2026
0b2ce10
API: moving to OpenBot Cloud counts files' bytes, and files land in t…
davidmckayv Nov 21, 2026
aa7b211
API: a busy move answers RATE_LIMITED, as every other 429 does
davidmckayv Nov 21, 2026
7481ed1
Desktop: move OpenBot (Self-Contained) to OpenBot Cloud
davidmckayv Nov 21, 2026
d9127a9
Desktop: sign in afresh for the move, and tidy a test type
davidmckayv Nov 21, 2026
a886f5f
Desktop: offer the move to OpenBot Cloud to people running OpenBot (S…
davidmckayv Nov 21, 2026
67e4eb5
Merge branch 'desktop-move-to-cloud-ui' into desktop-move-to-cloud
davidmckayv Nov 22, 2026
0e6063b
CI: run Settings' Move to OpenBot Cloud row in Chromium and WebKit
davidmckayv Nov 22, 2026
3352d90
API: examples for every move answer, so the browser's mock handlers n…
davidmckayv Nov 22, 2026
e7538e3
API boundary: the move's own addresses, built by hand in Rust
davidmckayv Nov 22, 2026
9e0495d
Merge remote-tracking branch 'origin/move-to-cloud-spec' into desktop…
davidmckayv Nov 22, 2026
a7e9711
Desktop: the move's test servers match parts by their own path
davidmckayv Nov 22, 2026
0e97d9f
Desktop: read the move from the OpenBot here in its one organization
davidmckayv Nov 22, 2026
5c083f1
Desktop: under Keep, say the move stays on offer in Settings
davidmckayv Nov 22, 2026
c1656f2
Desktop: count OpenBot's machine disk on a Mac when measuring the move
davidmckayv Nov 22, 2026
c6a1cf7
Desktop: the move's counts leave out messages, which include a Bot's …
davidmckayv Nov 22, 2026
7ff4f01
Merge remote-tracking branch 'origin/main' into desktop-move-to-cloud
davidmckayv Nov 22, 2026
24befd8
Desktop: never claim more space freed than the disk gained
davidmckayv Nov 22, 2026
200d836
Desktop: tidy a move test for clippy
davidmckayv Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ jobs:
# window zoomed in, narrowing the sidebar, which never takes more than two-fifths of the window.
# And the terms on OpenBot Cloud: the gate holding a person at them from anywhere until they tick
# the box and agree, asking again when they change, and never shown where there are none, in the
# engine the Mac window draws with too. In the image, as above: WebKit's
# engine the Mac window draws with too. And Settings' Move to OpenBot Cloud row and its dialog,
# in both engines. In the image, as above: WebKit's
# system packages are about 94 MB, which took nine minutes from the mirror on a slow day.
app-browser-webkit:
name: app (real browser, WebKit)
Expand All @@ -412,7 +413,7 @@ jobs:
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 --env OPENBOT_APP_ENGINES=chromium,webkit \
"$PLAYWRIGHT_IMAGE" \
bun test app/tests/composer-dictation-language.test.tsx app/tests/sidebar-zoom-drag.test.tsx app/tests/service-terms.test.tsx
bun test app/tests/composer-dictation-language.test.tsx app/tests/sidebar-zoom-drag.test.tsx app/tests/service-terms.test.tsx app/tests/move-to-cloud-settings.test.tsx

# The desktop setup window's, for the same reason as the list above: the AI step's form holding
# still while the install behind it comes and goes. It bundles the window from the desktop's own
Expand Down
12 changes: 12 additions & 0 deletions api/client-boundary.allow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,18 @@ export const ALLOWED: Allowed[] = [
rule: "hand-built-v2",
why: "the Recorder host's handoff, from Rust, which has no generated client",
},
{
file: "desktop/src-tauri/src/move_to_cloud.rs",
what: /^\/api\/v2\/(people\/me\/organizations|organizations\/\{\}\{path\})$/,
rule: "hand-built-v2",
why: "the move to OpenBot Cloud, from Rust, which has no generated client: the export from the OpenBot on this computer and the import into OpenBot Cloud, in the organization each answers for the person",
},
{
file: "desktop/src-tauri/src/move_to_cloud/tests.rs",
what: /^\/api\/v2\/(people\/me\/organizations|organizations\/(default|org_mine)\/(exports|imports)(\/[a-z0-9_]+)*\/?)$/,
rule: "hand-built-v2",
why: "the move's tests, against an OpenBot here and an OpenBot Cloud that answer as the API describes",
},
{
file: "desktop/src-tauri/src/install_token.rs",
what: "/api/install/enter",
Expand Down
102 changes: 100 additions & 2 deletions app/src/components/settings/connection-sections.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import {
IconCloudUpload,
IconDeviceLaptop,
IconListCheck,
IconLogout,
IconPlug,
IconPlugConnected,
IconShieldCheck,
} from "@tabler/icons-react";
import { useMutation, useQuery } from "@tanstack/react-query";
import { useState } from "react";
Expand Down Expand Up @@ -31,6 +35,7 @@ import {
import { Separator } from "@/components/ui/separator";
import {
changeConnectionMutationOptions,
moveToCloudMutationOptions,
signOutOfConnectedOpenBotMutationOptions,
} from "@/lib/desktop/mutations";
import { desktopStatusQueryOptions } from "@/lib/desktop/queries";
Expand Down Expand Up @@ -155,18 +160,29 @@ function SignOutRow({ host }: { host: string }) {
/**
* Settings → Computer inside an OpenBot Desktop that runs OpenBot on this computer: the way to
* connect to an OpenBot that runs somewhere else instead. Drawn under `ThisComputerSections`, and
* only by a desktop app that can connect.
* only by a desktop app that can connect. With `moveToCloud`, the move to OpenBot Cloud comes first
* (`MoveToCloudRow`).
*
* It stops OpenBot here, as Stop does, and the window shows setup at the choice of where OpenBot
* runs. This page goes with it.
*/
export function ConnectInsteadSection() {
export function ConnectInsteadSection({
moveToCloud = false,
}: {
moveToCloud?: boolean;
}) {
const [open, setOpen] = useState(false);
const change = useMutation(changeConnectionMutationOptions());
const leaving = change.isPending || change.isSuccess;
return (
<PageSection title="Connection">
<PageRows>
{moveToCloud ? (
<>
<MoveToCloudRow />
<Separator />
</>
) : null}
<Item size="sm">
<RowMark>
<IconDeviceLaptop className="size-4" />
Expand Down Expand Up @@ -219,6 +235,88 @@ export function ConnectInsteadSection() {
);
}

/**
* Move to OpenBot Cloud: everything this OpenBot keeps goes to the person's OpenBot Cloud account,
* then OpenBot is removed from this computer. The dialog says what happens; Continue asks the
* desktop app, which shows setup at the move with OpenBot still running, since what moves is read
* from it. Setup says what moves and asks again before anything does. This page goes with it.
*/
function MoveToCloudRow() {
const [open, setOpen] = useState(false);
const move = useMutation(moveToCloudMutationOptions());
// On success the desktop app is showing setup, and this page goes with it.
const leaving = move.isPending || move.isSuccess;
return (
<>
<Item size="sm">
<RowMark>
<IconCloudUpload className="size-4" />
</RowMark>
<ItemContent>
<ItemTitle>OpenBot Cloud</ItemTitle>
<ItemDescription className="line-clamp-none">
Move your Bots and their work to OpenBot Cloud, and free up space on
this computer.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button onClick={() => setOpen(true)} size="sm" variant="outline">
Move to OpenBot Cloud
</Button>
</ItemActions>
</Item>
<Dialog onOpenChange={setOpen} open={open}>
<DialogContent>
<DialogHeader>
<DialogTitle>Move to OpenBot Cloud?</DialogTitle>
<DialogDescription>
Your Bots, conversations, memory, skills, routines and files move
to your OpenBot Cloud account. Then OpenBot is removed from this
computer to free up space.
</DialogDescription>
</DialogHeader>
<DialogBody className="mt-4 text-sm">
<ul className="flex flex-col gap-3">
{[
{
icon: IconListCheck,
said: "Setup opens next and shows everything that moves before you confirm. You'll sign in to OpenBot Cloud in your browser.",
},
{
icon: IconPlug,
said: "Your app connections are private, so they can't move. You'll reconnect them in OpenBot Cloud.",
},
{
icon: IconShieldCheck,
said: "Nothing is removed from this computer until everything has arrived and been checked.",
},
].map(({ icon: Icon, said }) => (
<li className="flex gap-3" key={said}>
<Icon className="mt-0.5 size-4 shrink-0 text-muted-foreground" />
<span className="text-pretty">{said}</span>
</li>
))}
</ul>
{move.error ? (
<p className="text-destructive" role="alert">
Couldn't open setup. Try again.
</p>
) : null}
</DialogBody>
<DialogFooter className="mt-4">
<Button onClick={() => setOpen(false)} size="sm" variant="ghost">
Cancel
</Button>
<Button disabled={leaving} onClick={() => move.mutate()} size="sm">
{leaving ? "Opening setup…" : "Continue"}
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</>
);
}

function UseThisComputerRow({ host }: { host: string }) {
const [open, setOpen] = useState(false);
const change = useMutation(changeConnectionMutationOptions());
Expand Down
10 changes: 10 additions & 0 deletions app/src/lib/desktop/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ export function changeConnectionMutationOptions() {
});
}

/**
* Move to OpenBot Cloud. The desktop app shows setup at the move, with OpenBot still running here,
* since what moves is read from it: what moves, then the move itself. This page goes with it.
*/
export function moveToCloudMutationOptions() {
return mutationOptions({
mutationFn: (): Promise<void> => invokeDesktop("move_to_cloud"),
});
}

/**
* Check for updates now. The desktop app reads its update feed and keeps the answer, so the banner
* reads it too. Rejects with the app's own sentence when the feed couldn't be read.
Expand Down
17 changes: 14 additions & 3 deletions app/src/lib/desktop/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,19 @@ export type DesktopUsageData = {
* desktop app keeps that and the page never holds it.
*/
export type DesktopConnection =
/** `canConnect`: the desktop app is one that can connect to an OpenBot elsewhere. */
| { mode: "local"; address: null; canConnect: boolean }
/**
* `canConnect`: the desktop app is one that can connect to an OpenBot elsewhere. `moveToCloud`:
* its build offers OpenBot Cloud and this OpenBot hasn't moved there, so it can move everything
* there from this computer.
*/
| { mode: "local"; address: null; canConnect: boolean; moveToCloud: boolean }
| { mode: "connected"; address: string };

const ON_THIS_COMPUTER: DesktopConnection = {
mode: "local",
address: null,
canConnect: false,
moveToCloud: false,
};

export const desktopKeys = {
Expand Down Expand Up @@ -176,10 +181,16 @@ export function desktopConnectionQueryOptions() {
const answer = await invokeDesktop<{
mode?: string;
address?: string | null;
moveToCloud?: boolean;
}>("connection");
return answer?.mode === "connected" && answer.address
? { mode: "connected", address: answer.address }
: { mode: "local", address: null, canConnect: true };
: {
mode: "local",
address: null,
canConnect: true,
moveToCloud: answer?.moveToCloud === true,
};
} catch {
return ON_THIS_COMPUTER;
}
Expand Down
4 changes: 3 additions & 1 deletion app/src/routes/_authed/settings/computer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ function ComputerPage() {
) : (
<>
<ThisComputerSections />
{connection.canConnect ? <ConnectInsteadSection /> : null}
{connection.canConnect ? (
<ConnectInsteadSection moveToCloud={connection.moveToCloud} />
) : null}
</>
)}
<BrowserSections />
Expand Down
50 changes: 47 additions & 3 deletions app/tests/desktop-connected-settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ const LOCAL_STATUS: DesktopStatus = {
appPort: 3010,
};

type Shell = "connected" | "local" | "older";
/** `movable`: OpenBot on this computer, in a desktop build that offers OpenBot Cloud. */
type Shell = "connected" | "local" | "movable" | "older";

/** Every command the page asked the desktop app, in order. */
let asked: string[] = [];
Expand All @@ -80,13 +81,20 @@ function installShell(kind: Shell) {
if (kind === "older") throw "command connection not found";
return kind === "connected"
? { mode: "connected", address: ADDRESS }
: { mode: "local", address: null };
: kind === "movable"
? { mode: "local", address: null, moveToCloud: true }
: { mode: "local", address: null };
}
if (name === "status")
return kind === "connected" ? CONNECTED_STATUS : LOCAL_STATUS;
if (name === "update_offer")
return { version: null, current: "1.1.0", installing: null };
if (name === "sign_out" || name === "change_connection") return null;
if (
name === "sign_out" ||
name === "change_connection" ||
name === "move_to_cloud"
)
return null;
throw `command ${command} not found`;
},
};
Expand Down Expand Up @@ -200,6 +208,42 @@ test("Connect to an OpenBot asks first, saying OpenBot stops here and nothing is
await waitFor(() => expect(asked).toContain("change_connection"));
});

test("Move to OpenBot Cloud says what happens first, then asks the desktop app to open the move", async () => {
const view = renderComputer("movable");
fireEvent.click(
await view.findByRole("button", { name: "Move to OpenBot Cloud" }),
);
const dialog = await view.findByRole("dialog");
expect(dialog.textContent).toContain("Move to OpenBot Cloud?");
expect(dialog.textContent).toContain(
"Your Bots, conversations, memory, skills, routines and files move to your OpenBot Cloud account.",
);
expect(dialog.textContent).toContain(
"Your app connections are private, so they can't move.",
);
expect(dialog.textContent).toContain(
"Nothing is removed from this computer until everything has arrived and been checked.",
);
expect(asked).not.toContain("move_to_cloud");
fireEvent.click(
Array.from(dialog.querySelectorAll("button")).find(
(button) => button.textContent === "Continue",
) as HTMLButtonElement,
);
await waitFor(() => expect(asked).toContain("move_to_cloud"));
// Moving is not stopping: OpenBot keeps running for the move to read from.
expect(asked).not.toContain("stop");
expect(asked).not.toContain("change_connection");
});

test("Move to OpenBot Cloud is offered only by a desktop build that offers OpenBot Cloud", async () => {
const view = renderComputer("local");
await view.findByRole("button", { name: "Connect to an OpenBot" });
expect(
view.queryByRole("button", { name: "Move to OpenBot Cloud" }),
).toBeNull();
});

test("a desktop app from before it could connect is read as OpenBot on this computer", async () => {
const view = renderComputer("older");
await view.findByRole("heading", { name: "App" });
Expand Down
63 changes: 63 additions & 0 deletions app/tests/move-to-cloud-settings.fixture.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { QueryClientProvider } from "@tanstack/react-query";
import {
createBrowserHistory,
createRootRoute,
createRoute,
createRouter,
Outlet,
RouterProvider,
} from "@tanstack/react-router";
import type { ReactNode } from "react";
import { createRoot } from "react-dom/client";
import { SidebarShell } from "@/components/layout/sidebar-shell";
import { SettingsSidebar } from "@/components/settings/settings-sidebar";
import { ThemeProvider } from "@/components/theme-provider";
import { SidebarInset } from "@/components/ui/sidebar";
import { setCurrentOrganization } from "@/lib/organizations/current";
import { queryClient } from "@/query-client";
import { Route as ComputerRoute } from "@/routes/_authed/settings/computer";

/**
* Settings → Computer in the app's real settings frame, inside OpenBot Desktop with OpenBot on this
* computer, for move-to-cloud-settings.test.tsx to bundle and load in a browser. The desktop app is
* the test's `__TAURI_INTERNALS__`, and the server its routes.
*/
setCurrentOrganization("default");

const rootRoute = createRootRoute({ component: () => <Outlet /> });

const settingsRoute = createRoute({
getParentRoute: () => rootRoute,
id: "settings-frame",
component: () => (
<SidebarShell className="h-svh overflow-hidden">
<SettingsSidebar />
<SidebarInset className="min-h-0 min-w-0 overflow-hidden">
<Outlet />
</SidebarInset>
</SidebarShell>
),
});

const router = createRouter({
history: createBrowserHistory(),
routeTree: rootRoute.addChildren([
settingsRoute.addChildren([
createRoute({
getParentRoute: () => settingsRoute,
path: "/settings/computer",
component: ComputerRoute.options.component as () => ReactNode,
}),
]),
]),
});

const root = document.getElementById("root");
if (root)
createRoot(root).render(
<QueryClientProvider client={queryClient}>
<ThemeProvider>
<RouterProvider router={router as never} />
</ThemeProvider>
</QueryClientProvider>,
);
Loading
Loading