Repository navigation
fix(desktop): keep the window responsive while installation holds the startup lock - #822
Open
dustywusty wants to merge 1 commit into
Open
dustywusty wants to merge 1 commit into
dustywusty wants to merge 1 commit into
Conversation
… startup lock restore_window_on, which runs on the event loop for the macOS reopen event and the tray/menu "Open OpenBot" item, waited on shell.startup. prepare_installation holds that lock for the whole image download, so focusing or clicking the window during an install hung the UI (spinning cursor) until the download finished. When the lock is busy, the restore now shows and focuses the window as it is and skips only the choice between the setup page and the app, which is made again next time. With the lock free nothing changes.
dustywusty
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
October 21, 2026 18:48
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
While "Install OpenBot" downloads local software, clicking or focusing the window shows the spinning cursor until the download finishes; the window can also stop repainting.
restore_window_onnow usestry_lockonshell.startup: when installation holds it, the window is shown and focused as it is (it is already on the setup screen) and only the "setup page or app" decision is skipped, to be made next time. With the lock free, behavior is unchanged.Root cause
restore_window_onhas takenshell.startup.lock()since Setup, end to end: pick a Bot, connect a model, prove it answers #451 (c21ba2b, 11 Sep).prepare_installationhas held the same lock across the whole image download since Fix fresh desktop setup and Mac sign-in #591 (2e43afd, 16 Sep). The freeze dates from Fix fresh desktop setup and Mac sign-in #591, when the two met.restore_window_onruns on the event-loop (main) thread for the macOS reopen event and for the tray/window menu "Open OpenBot" item, so it blocked the UI thread on a lock held for minutes.sampleof the live process during an install showed the main thread inapplication_should_handle_reopen→show_whichever_applies→restore_window_on→Mutex::lock→__psynch_mutexwait.restore_window_shows_setup_without_waiting_for_startup_held_by_installationholds the lock on another thread and requires the restore to finish within 5 s with the window visible on the setup page, then checks the normal destination once the lock is free. It failed before the change (Timeout).already_runningandlast_failureare synchronous Tauri commands that also take the lock on the main thread; the window calls them only when the setup page loads, so they block only if that page reloads mid-install. Making them#[tauri::command(async)]would close that too.Where it runs
Boundary and audit
Changelog
CHANGELOG.mdunderUnreleased("The desktop window answers while software is installing").Proof
cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo test --locked --lib --bins(541 lib, 150 bin) pass on macOS arm64. Windows and Linux left to CI.