Skip to content

Desktop: a quit after connecting to an OpenBot elsewhere is not setup abandoned - #2791

Merged
davidmckayv merged 24 commits into
mainfrom
alex/2026-12-01/reshown-first-screen-not-abandoned
Dec 3, 2026
Merged

davidmckayv merged 24 commits into
mainfrom
alex/2026-12-01/reshown-first-screen-not-abandoned

Conversation

@ACl365

@ACl365 ACl365 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

The bug

#2566's merge note: "On a later launch where the first screen shows again (Sign in again after a sign-in ended), step_viewed connect_openbot still starts a setup session, so a quit there counts as setup_abandoned." The same held for the welcome every launch records: a connection to an OpenBot that runs elsewhere never sends activated, and a completed openbot_connect ended the session for that launch only.

The fix

What proves setup ended is the choice the app keeps. Connected is first written once a connection has worked: Connect through the relay, the window's own sign-in once the browser sign-in comes back (#2768), or Move to Cloud. While it's on record, each step_viewed is still sent but starts no session (record_step_after_setup); keeping the choice closes any open session (keep), with or without completed; and a crash's leftover session closes quietly at the next launch (open_with_setup). Choosing OpenBot (Self-Contained) starts a setup at its first screen (use_this_computer). setup_failed still names the last screen shown.

No event, property or value is added or renamed. Beside setup_abandoned, what is sent changes only by that welcome, a first view after usage data is turned back on, and a repeated screen after a keep without completed. A setup_abandoned an earlier release recorded can still arrive after the update, so compare by openbot_version. desktop/TELEMETRY.md says all of this. Nothing changes in the window.

Route to the first screen Quit or crash after it Test
First setup on this computer, a relaunch during it abandoned until activated; Restart now on Windows sends setup_restart_required (both unchanged) a_plain_quit_during_setup_still_sends_setup_abandoned, next_launch_records_abandoned_step_after_crash_before_activation, a_planned_windows_restart_sends_restart_required_and_setup_goes_on_after_it
First launch, sign-in started, failed or cancelled abandoned (unchanged) first-setup cases of a_first_screen_shown_again_after_a_connection_is_not_abandoned_on_quit_or_crash; cancelled in telemetry.rs
First launch, connected (relay or window sign-in) not abandoned; now also when the window names no screen a_first_launchs_connect_through_the_relay_ends_setup_so_its_quit_is_not_abandoned, a_window_sign_in_ends_setup_and_its_sign_in_again_is_not_abandoned
Window sign-in let go, choice still connected now not abandoned a_saved_window_sign_in_no_longer_published_is_not_abandoned
Later launch, signed in or Sign in again now not abandoned connected cases of the first-screen test; App.test.tsx
While connected: sign-in ends, OpenBot unreachable, Sign out, Use this computer in Settings now not abandoned a_first_screen_shown_again_by_{an_ended_sign_in,an_unreachable_openbot,a_sign_out,settings_change}_is_not_abandoned
First launch of this release after a connected crash now closed quietly a_connected_launch_closes_the_session_an_earlier_crash_left
OpenBot (Self-Contained) chosen there new setup, abandoned until activated (an installation activated before stays so) use_this_computer cases of the first-screen test; App.test.tsx
Move to Cloud now not abandoned a_connection_kept_by_move_to_cloud_ends_the_setup_session
Usage data off, then on now the first view counts a_step_shown_before_an_opt_out_names_nothing_after_it
Organization switch, usage data off alone unchanged a_connection_kept_ends_the_open_setup_session_and_sends_nothing, a_setup_failure_after_a_screen_shown_again_names_that_screen, turning_usage_data_off_writes_the_opt_out_and_prevents_telemetry_link
Cloudflare's (#1932) or xAI's model sign-in on the AI screen abandoned at the AI screen until activated, before or after model_chosen (unchanged) a_model_sign_in_on_this_computer_is_abandoned_until_activated
While connected through the relay: a page load the relay refused, or the window opened again on that refusal (#2883) not abandoned: the window goes back through the relay's entry at the same page, never to the first screen, and #2883 records nothing (unchanged by this change) a_first_launchs_connect_through_the_relay_ends_setup_so_its_quit_is_not_abandoned; #2883's a_window_the_relay_refused_goes_back_through_the_entry_when_it_is_opened_again and three more

Not tested alone: the window shown again from the Dock or tray, its same-launch return to the first screen, and Settings' Change while OpenBot runs on this computer, which follow the record_setup_event rule for the screen shown; the Business booker, which never calls keep. The connected rows are tested on quit; a crash there is open_with_setup, tested by the first-screen and earlier-crash tests. The model sign-in's commands (begin_model_oauth, finish_model_oauth, provider_oauth) record nothing, by reading. Per #1932's providers, Cloudflare is offered only where the folder already holds its sign-in or the OpenBot running there serves it, neither of which a first setup has; the AI screen isn't shown while connected. Since then main merged #2883 (the window's way back from the relay's refusal), which shares desktop_connected.rs, main.rs and window_ipc_tests.rs with this change but no route: it records nothing, ends no setup session and never shows the first screen (its row is above). Nothing else merged on main reaches these screens.

Known limit, new and narrow: a screen recorded while a connection is being saved can read the choice before the save and start a session after it closes. The limits from before this change are unchanged.

Where it runs

  • No new state, replica behaviour, serialisation, fan-out, listener, port or schedule: Desktop's usage data, queued on each computer, in the same telemetry-state.json and connection.json.

Boundary and audit

  • Nothing new acts, refuses or is trusted.

API and database

  • Nothing under api/, no request, no database change, no release-policy.json.

Changelog

OpenBot Desktop.

  • Usage data no longer counts a connected Desktop's quit as setup abandoned. While you share usage data, once OpenBot Desktop is connected to an OpenBot that runs elsewhere, quitting it, or a crash, no longer counts as setup abandoned. That holds at any launch, and when its first screen shows again, such as Sign in again, or Use this computer in Settings. That screen is still counted, and a first setup that quits before its sign-in comes back from the browser still counts as abandoned. Nothing changes in the app (desktop/TELEMETRY.md).

Proof

Each rule switched off alone fails tests (cargo test --bin openbot-desktop connected_ipc, on 79c854c49); restored, all 40 pass. The new tests can't run on main as a whole: they use test seams this change adds (initialize_for_test, record_for_test).

Switched off Fails
record_setup_event's rule 8: seven with SetupAbandoned { step: ConnectOpenbot } on quit, and a setup failure there no longer named at connect_openbot
keep's call to setup_ended 3: Move to Cloud, and Connects that name no screen
setup_ended_with_connection 9: those 8 and the earlier version's crash
end_setup_session keeping the last screen when no session is open (made to clear it) 2: the setup failure above, and cargo test --lib telemetry::tests::a_connection_kept_ends_the_open_setup_session_and_sends_nothing
setup_ended_with_connection also true for an address kept after OpenBot (Self-Contained) is chosen 2: the first-screen test's choose-this-computer cases, and the model sign-in test after a connection

Real build, macOS only, on the head be9b47a6a (3 December, after the merge of today's main incl. #2883): a debug build, OpenBot Cloud on as in release builds, its own installation. PostHog, read 20:36 UTC, by that installation's id:

Launch Sent
First launch, Quit on the first screen welcome, setup_abandoned welcome (read 20:21)
Sign in, connected, Quit welcome, openbot_connect cloud started, completed; nothing after it from that launch
Next launch, connected, Quit welcome; no setup_abandoned

Earlier the same day, on 171e7f40f (before #2883; the routes below are not touched by it), six launches, read 18:36 UTC:

Launch Sent
First launch, Quit on the first screen welcome, setup_abandoned welcome
Sign in pressed, app closed before the browser came back welcome, openbot_connect cloud started; the next launch sends setup_abandoned welcome
Sign in, connected, Quit welcome, started, completed; nothing after it from that launch
Next launch, connected; Use this computer in Settings shows the first screen; Quit welcome, connect_openbot; no setup_abandoned
Next launch, at that first screen; Quit welcome, connect_openbot; no setup_abandoned
Next launch, OpenBot (Self-Contained) chosen, Install stopped (this check's home has no Compose plug-in), Quit welcome, connect_openbot, welcome on the choice, harness_chosen, account, setup_failed, setup_abandoned account

On main, the two connected quits send setup_abandoned (#2566's merge note). Windows and Linux: library and IPC tests in CI only.

Local: on be9b47a6a, cargo test --lib 1719 passed and --bins 542 passed; one fails as on main on this Mac (osascript_saying_user_canceled_is_a_closed_prompt, macOS in British English). bun test desktop/src 717 passed. cargo fmt, and biome and tsc on desktop/, clean; clippy clean apart from main's two lints in local_eval_ipc_tests.rs and main's unused zip dependency (neither file is in this change).

CI on be9b47a6a: green, 45 checks passed and 9 skipped (read 3 December 21:21 UTC): CI, Desktop, Desktop upgrade, Windows signing and macOS signing. In the first attempt the WebKit app shards, the macOS startup job and the release note (CI) and the Windows and macOS app jobs (Desktop) were cancelled, and CI's verify failed with them; both workflows were re-run once and every job passed.

Desktop sends setup_abandoned on quit, or at the next launch after a
crash, while the installation is not activated and a setup step was
viewed since setup last ended. A connection to an OpenBot that runs
elsewhere never sends activated; a completed openbot_connect ends the
setup session instead, but only for that launch. Every launch records
the first screen viewed, and the first screen also shows again in an app
that is already connected: a sign-in that ended (Sign in again, at
launch or while OpenBot shows), a saved OpenBot that cannot be reached,
or the choice of where OpenBot runs asked for again from Settings. Each
of those started a new setup session, so quitting a connected app, even
one that opened its OpenBot and never showed setup, counted as
setup_abandoned. True before the connection was counted, and it would
show in the onboarding funnel as abandonment by people who are set up.

The app keeps the choice to be connected only once a connection has
worked (Connect from the first screen, or Move to Cloud). Keeping it now
closes any setup session still open, whether or not a completed was sent
(a Connect whose window named no screen, or Move to Cloud from an
OpenBot here whose activation was never recorded). While that choice is
on record, the launch's first screen and every step_viewed from the
setup window are recorded and sent as before, but start no setup
session: neither a quit nor a crash says setup_abandoned for them, also
after a Sign in again that only started or failed. A launch reads the
choice before it opens its usage data, and closes a setup session the
last run left open (a crash, or an earlier version's launch) without a
setup_abandoned in that same write, so nothing false is queued.

Choosing This computer there starts a setup on this computer at its
first screen, as a first launch does, before the window shows anything;
a quit or a crash before activated abandons it, as it does a first setup
left at the same screen. The window's own first view is not counted
twice. setup_failed still names the last screen shown, including one
shown after setup, and nothing from before a usage-data opt-out names it
after. Nothing changes in the window or in the event schema; choosing
This computer sends one step_viewed welcome at once, as a launch does,
even when the window then resumes past Welcome. After usage data is
turned back on in Settings, the first view counts again under the new
installation id.

Tests: the library's session rule, the same screen then starting a
setup, the last screen shown, the opt-out and the duplicate rule it
resets, a launch that knows setup ended (a full queue, an earlier quit's
real abandonment kept), and a kept connection ending the session; and
through open_then_launch (initialize's launch), record_setup_event,
use_this_computer and keep_moved_choice under the setup window's origin,
with a real connection.json and exact events as the quit or the crash
leaves them and after the next launch of an app on the same files and
the choice the last run kept, an earlier version's crash, a sign-in
ending while OpenBot shows (session_ended) and a saved OpenBot that
cannot be reached (show_connected failing), a test each, and a setup
failure after a screen shown again. App.test.tsx pins the window's
step_viewed on the unreachable screen and on the choice asked for from
Settings. Each rule fails its test when turned off, a Quit that does
nothing included. desktop/TELEMETRY.md says what ends setup, what is
still abandoned, what This computer sends, where a failure is placed,
and that setup_abandoned is compared across this change by
openbot_version; the CHANGELOG line also names This computer's welcome
and the count after an opt-out.
…n is not abandoned

Since the window can sign in at OpenBot's own origin with OpenBot's own
session cookie, there are two more ways through setup's end. Connecting
there keeps the choice to be connected (with the window's origin), which
ends setup as any kept connection does. And the window's sign-in can be
let go with the choice still connected: OpenBot's page could not trade
its code, or a saved window sign-in that OpenBot no longer publishes. The
first screen then shows Sign in again, which is counted and starts no
setup session, so neither a quit nor the next launch says
setup_abandoned.

Tests, through the shell's own commands against the window stand-in:
a first launch that connects through the window, then a code the page
could not trade, then Sign in again, then quit and the next launch; and
a launch whose saved window sign-in is no longer published. The first
fails with setup_abandoned when either the kept connection's end of
setup or record_setup_event's after-setup rule is turned off; the second
fails when the after-setup rule is turned off (its launch already knew
setup had ended). desktop/TELEMETRY.md names both ways.
… repeated screen after setup ends

The window's own sign-in keeps the connection once the browser sign-in
comes back, just before the window trades its code for its session at
that OpenBot, so setup has ended from then; a trade that fails then shows
Sign in again, which is not abandoned. And a screen said twice in a row
counts once unless setup ended between the two: ending setup forgets the
last screen, so the same screen shown again after it is counted again.
…onnection

The comments on keep and setup_ended_with_connection also name
connect_window_now, which keeps the connected choice once the window's
own sign-in came back from the browser, just before the page trades its
code. open_then_launch's comment names first_screen, which records the
launch's first screen by the same reading of the choice. The comment on
a screen shown after setup, then the same screen starting a setup, says
no current window flow puts the two side by side. desktop/TELEMETRY.md
says completed is counted when the window named the screen it was
pressed on (screen).
stop_sharing cleared the last screen shown and the duplicate rule's last
view with ? before it deleted the state file, so a lock poisoned by a
panic returned an error and left the file behind until the next launch
with sharing off. Each is now cleared only if its lock can be taken, and
the file is always deleted. Test: both locks poisoned, then the opt-out
deletes the file; it failed with Poisoned before.

The test of a screen shown after setup, then the same screen starting a
setup, now also crashes after the two views and asserts that the next
launch says that setup abandoned, so the saved write on that path is
tested: it fails when that write is skipped.
ACl365 added 12 commits December 2, 2026 14:24
CHANGELOG.md is written by the release from the notes in pull requests'
descriptions, so this change leaves it as it is on main and carries its
note under the description's Changelog heading instead.
…doned

A first launch's Connect from the first screen, through the relay, with and without the
screen named, then a quit and the next launch: no setup_abandoned either way, and completed
only when the screen is named. The window stand-in now also answers an authorization of the
app's own sign-in, sending the browser back with a code.
…agraphs

setup_failed's step is the last screen shown, which setup ending clears; a connection kept
with no setup session open, such as an organization switch, leaves it as it was
(end_setup_session returns before clearing it). The same in the comments on last_step_shown
and end_setup_session. setup_abandoned's paragraph is split into short ones with the same
facts, and a test's comment is wrapped to the file's width.
… are not abandoned

Sign out keeps the address, so the first screen it puts up is shown again: no setup_abandoned
on quit or at the next launch. The window sign-in test now runs Connect as the window asks it,
with the screen named (started and completed before the trade), and without, the defensive
case; the relay test shares the same Connect. App.test.tsx pins the welcome the window says
after OpenBot (Self-Contained) is chosen on the first screen shown again. The file's header and
one test's doc say what the tests run.
… with their event

setup_abandoned is setup ending before activation or before a connection is kept, and each
paragraph after it opens with the event it is about. setup_failed's step names
openbot_connect completed in full. use_this_computer's comment says it starts a setup, and two
comments are wrapped to 100 columns.
…pen keeps the step

Settings' Change while connected keeps the address, so the first screen it opens is shown
again: no setup_abandoned on quit or at the next launch. A connection kept with no setup
session open, such as an organization switch, leaves the last screen shown, in the library
and through set_organization_now before a setup failure. The quit and next-launch checks are
one helper, and a launch connected to any address another.
…dow's completed is counted

setup_abandoned names Connect through the relay, the window's own sign-in and Move to Cloud
in a sentence each. openbot_connect's completed, through the window's own sign-in, is
counted once the window goes to the page that trades its code, before the trade. launched's
comment says it is use_this_computer's view, as a launch views it.
An organization switch (set_organization_now) and a window sign-in let go
(forget_window_sign_in) also keep a Connected choice. Both run only once
the choice is already connected, so setup had already ended there, and
ending it again changes nothing. Comment only.
@ACl365 ACl365 changed the title Desktop connected to an OpenBot elsewhere is not setup abandoned on quit Desktop: a quit after connecting to an OpenBot elsewhere is not setup abandoned Dec 3, 2026
…ow side, the model sign-in test says what it covers, one name for Use this computer in Settings

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Tying "setup ended" to the saved connection fixes the false abandoned count on every route in your table, and the tests run through the real app commands. One gap for a follow-up: the window's own sign-in saves the connection before the code trade (desktop_connected.rs:1309), so a first setup whose trade fails and then quits is no longer counted as abandoned. It's documented and matches how completed already works, so it doesn't block this.

@ACl365
ACl365 enabled auto-merge December 3, 2026 23:09
@ACl365
ACl365 disabled auto-merge December 3, 2026 23:10
@ACl365
ACl365 enabled auto-merge December 3, 2026 23:15
@ACl365
ACl365 disabled auto-merge December 3, 2026 23:16
@davidmckayv
davidmckayv added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 7323bf7 Dec 3, 2026
92 of 100 checks passed
@davidmckayv
davidmckayv deleted the alex/2026-12-01/reshown-first-screen-not-abandoned branch December 3, 2026 23:33
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.

2 participants