Skip to content

OpenBot Desktop tells OpenBot Cloud which installation signed in - #2956

Draft
ACl365 wants to merge 1 commit into
mainfrom
alex/2026-12-04/record-desktop-installation-callers
Draft

ACl365 wants to merge 1 commit into
mainfrom
alex/2026-12-04/record-desktop-installation-callers

Conversation

@ACl365

@ACl365 ACl365 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

OpenBot Desktop now tells OpenBot Cloud which installation signed in, through the operation #2932 added. Usage data can then join what an installation did before the sign-in with what the person does after it. Only OpenBot Cloud is told, and only while usage data is shared.

Why

OpenBot Cloud's events carry Cloud's own deployment_id. Desktop's events carry its installation id, the random UUID its usage data is sent under. Nothing joins the two today.

What changed

  • The window's sign-in. Desktop adds installation_id=<uuid> to the hand-off fragment, beside the code (connected/window.rs). The /desktop/signed-in page takes the fragment off the address as before, and once the code is traded sends the id with its new session (window-session.ts). Once, with a new Idempotency-Key and keepalive, no retry. A failed trade, no id, the id twice or anything but a version 4 UUID sends nothing.
  • Move to Cloud's sign-in. Desktop sends it itself, on its own thread (desktop_move.rs, move_to_cloud.rs). Before the request, and again once the token is in hand, it checks: Cloud's address, usage data on under the same id, the sign-in not ended, no sign-out begun, under 20 seconds. No redirect followed, no retry.
  • A new client option, renew: false. On a 401 asking for the hosted sign-in to be renewed, the shared client keeps the refused write and renews, so the report would be sent again later, the id held in session storage. The report passes renew: false: no renewal, nothing kept. Other calls are unchanged.
  • OpenBot Cloud only. Sharing usage data is consent to CopilotKit, not to a company's own server. cloud::links_installation takes only api.open.bot and my.open.bot, https, default port. The window path checks the address and the window's origin. The id is never logged.

What the leaders do

  • GitLab sends Service Ping per instance, under the admin's setting. Grafana does the same with reporting_enabled. A person's choice in a client is not sent to a company's own server.
  • PostHog joins activity before and after sign-in inside its own product. Here it is a join, not a merge: no PostHog person is aliased.

This follows them: only the vendor's own service is told.

Routes

Route Sends? Test
Window sign-in to OpenBot Cloud (button, typed address, Sign in again, Settings, the window's own sign-in screen, Try again), usage data on yes, once, after the trade Rust golden address + gate; app test; real browser
Same, usage data off, DO_NOT_TRACK, or no id yet no Rust
A company's OpenBot, staging, http, another port, a lookalike host no Rust
A newer Desktop and today's Cloud page key ignored, signs in real Mac
An older Desktop; the id malformed, not v4, or twice; trade failed or still waiting; reload or Back no app tests
Report answered 200, 401 (with or without renewal), 404, 429, 500, none logged by status, no retry, no renewal app tests
Move to Cloud's fresh sign-in yes, once Rust, local server
Move cancelled or failed after its sign-in yes, with the sign-in source check
Move reusing an earlier sign-in this launch no source check
Move: usage off, id changed, sign-in ended, sign-out begun (also while the token is read), past 20 s, staging, a company's OpenBot no Rust
Move answered non-204 or a redirect logged, not followed, no retry Rust
Relay sign-in, a resumed launch, a launch after Move to Cloud no not a fresh window sign-in

Not covered here: Move to Cloud's thread end to end, since its base is the real Cloud address. What it runs is tested against a local server.

Tests

Across each boundary, neither side mocked:

  • Desktop to page: fixtures/desktop-window-signed-in-address.json holds what signed_in_address builds; Rust holds the function to it, and the page test reads it with the real takeWindowSignIn.
  • Page to spec: the generated client against the spec's generated handler and strict schema. In Chromium and WebKit, the page sends one POST after the trade, with the session cookie; answered 204, nothing logged.
  • Desktop to spec: Rust holds the bytes Move to Cloud sends to fixtures/desktop-installation-request.json, and api/openapi-desktop-installations.test.ts parses that file with the spec's strict schema.

Red, then green, at 557106e50 (each change undone, then put back):

page: the record call removed          without: 11 pass, 11 fail   with: 22 pass, 0 fail
page: renew: false removed             without: 21 pass, 1 fail    with: 22 pass
page: the id twice taken               without: 21 pass, 1 fail    with: 22 pass
Rust: the fragment's id pair removed   without: 0 pass, 1 fail     with: 1 pass
Rust: Move's Cloud check removed       without: 0 pass, 1 fail     with: 1 pass  (staging got it)
Rust: the check after the token gone   without: 0 pass, 1 fail     with: 1 pass
Rust: the UUID variant check gone      without: 0 pass, 1 fail     with: 1 pass
Rust: a property added to the body     without: 0 pass, 1 fail     with: 1 pass

Local runs at 557106e50: page test 22, real browser 44, bun test api/ 144 (14 skip), move_to_cloud 52, connected:: 106, desktop_telemetry 27, desktop_move 2, desktop_connected 2, all pass; tsc, lint, format, clippy clean. Full --lib --bins: all pass but 3 tests outside this PR that fail the same on main here (an en_GB spelling, 30 GB free disk).

On a real Mac

A debug build with OpenBot Cloud on, own bundle id, home and project, Apple silicon, macOS 26.5.1. Built from ac9375ca9; Desktop's code at the head is the same. Today's OpenBot Cloud, 4 Dec (UTC):

  1. Usage data on. The first screen showed Sign in to OpenBot Cloud. The window landed signed in, with the account's conversations.
    18:59:27.975Z [connect] the window signs in at api.open.bot, with this installation's id
    18:59:28.063Z [front] the browser sign-in ended: signed in
    
  2. Usage data off (DO_NOT_TRACK=1, a second home and project):
    19:03:35.912Z [connect] the window signs in at api.open.bot, without the installation's id
    19:03:35.999Z [front] the browser sign-in ended: signed in
    
  3. No UUID appears anywhere in the log.

Both runs then log the window holds no session four times and page error: Error: A object was thrown (at https://my.open.bot/desktop/signed-in:291:145). Builds from before this change log the same, and run 2 has no id.

Not run: Move to Cloud (it would move a real project). After the server change is on OpenBot Cloud: one sign-in from this PR's build, then a PostHog query for oss.runtime.openbot.desktop_installation_linked with its installation_id.

Where it runs

  • No new server state, nothing serialised, no fan-out, no change on a second replica. Desktop counts sign-outs in memory per launch, and starts one short thread per fresh Move to Cloud sign-in.

Boundary and audit

  • No gateway, refusal or audit changes. The server takes only the installation id from the client, which it can't resolve itself.

API and database

Merge order

  • The server change is merged but not on OpenBot Cloud yet. Until then a sign-in isn't linked; nothing waits on merge order.
  • API: recordDesktopInstallation, record the OpenBot Desktop installation the caller signed in from #2932's Changelog says "No app sends it and no server answers it in this release". The first half is out of date once this merges.
  • Desktop: end setup when OpenBot's page says the window's code traded, not before #2934 shares six files (window-session.ts, desktop-window-sign-in.test.tsx, desktop/TELEMETRY.md, window.rs, desktop_connected.rs, desktop_telemetry.rs). In finishWindowSignIn: record, then its signal. The second to merge rebases.
  • Turning usage data off while the page trades the code doesn't stop that one send (documented).
  • A sign-out of OpenBot Cloud doesn't make a new installation id, so a second person on the same computer links the same installation. PostHog's reset() on sign-out points to a new id, but that changes every later Desktop event's deployment_id. That is a follow-up; say if you want it here.

Changelog

Web app and OpenBot Desktop.

  • Added: OpenBot Cloud is told which installation signed in. While you share usage data, signing in to OpenBot Cloud, or moving to it, tells OpenBot Cloud this installation's random id, the one its usage data is sent under. Usage before and after the sign-in can then be joined. Only OpenBot Cloud is told, never a company's OpenBot.

While usage data is shared, the window's sign-in hands OpenBot Cloud's page the
installation id in the fragment, and the page sends it with its new session once
the code is traded. Move to Cloud's fresh sign-in sends it itself. Only OpenBot
Cloud's own address is told, never staging or a company's OpenBot. One request
each, a new Idempotency-Key, no retry, only a 204 counts, and the id is never
logged. The page's report passes a new client option, renew: false, so a 401
asking for a sign-in renewal starts none and keeps nothing to send again.
@ACl365
ACl365 force-pushed the alex/2026-12-04/record-desktop-installation-callers branch from 557106e to acd0b42 Compare December 4, 2026 19:41

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