Skip to content

API: moving to OpenBot Cloud (export, import, verify) - #1998

Open
davidmckayv wants to merge 3 commits into
mainfrom
move-to-cloud-spec
Open

davidmckayv wants to merge 3 commits into
mainfrom
move-to-cloud-spec

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

The API for moving from OpenBot Desktop (everything on the person's own computer) to OpenBot Cloud, so nobody loses work. Spec and regenerated client only; the server side follows.

New area api/openapi/moves.yaml, tag "Moving to OpenBot Cloud", scopes exports:read|write and imports:read|write.

How OpenBot Desktop runs a move:

  1. Cloud createImport into the chosen organization (the person's own by default). The answer carries recipientKey, an RSA-OAEP-256 public JWK made for that import alone, and the size limits.
  2. Local getExportEstimate: counts by kind, rough bundle size, storedBytes (what removing the local OpenBot frees), the apps to reconnect, and whether a model key could come along.
  3. Local createExport (includeModelKeys plus recipientKey when the person opts in), then getExport until ready: parts of at most 32 MiB with size and SHA-256, total size, counts by kind, reconnect.
  4. downloadExportPart per part (Range for resume) and Cloud uploadImportPart per part. Part 1 carries the manifest; an arrived part re-sent is a no-op, a damaged one is refused and can be re-sent.
  5. Cloud applyImport, then getImport until imported: ids remapped, everything owned by the caller, nothing outside that organization. Summary notes say what came in differently (an isolated Bot as an ordinary Bot, a Business-plan feature left out, an existing AI connection kept).
  6. Cloud getImportVerification: expected, found and leftOut per kind, read from what is stored, and for files expectedBytes and foundBytes read from the file store, and matches. Desktop removes nothing until it is true.

Files land where a file uploaded on Cloud lands: the organization's own place in OpenBot's file store, never a shared location.

What never moves: a connection's sign-in. Each app connection travels as its app id, name, account label, icon and the Bots that used it (ReconnectApp), on the estimate, the export, the import and the verification, so Desktop can list exactly what to reconnect. A model key moves only when the person chooses, sealed as a JWE to the import's key, so the bundle never holds it readable; on Cloud it becomes the person's own AI connection.

Repeating is safe: an import of the same OpenBot into the same organization adds only what isn't there yet. Exports are served only by an OpenBot on the person's own computer, imports only by OpenBot Cloud; elsewhere both answer 404 MOVE_UNAVAILABLE. Limits: 10 imports a day and 120 part uploads a minute per person, 32 MiB a part, a bundle at most maxBundleBytes.

Checks run: bun run api:generate (bundle and clients), bun run api:lint, bun test api/.

Exports on an OpenBot on the person's own computer: what an export would hold and free, a bundle in parts with sizes and SHA-256, resumable downloads with Range. Imports on OpenBot Cloud only: a per-import public key a model key is sealed to, resumable part uploads, apply in the background, and a verification that counts what arrived by kind. Connections to apps travel as app and account names only, listed for reconnecting.
…he organization's own store

MoveCount carries bytes for files, and the verification compares expectedBytes with foundBytes read from the file store.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant