fix(desktop): improve setup, local startup and provider OAuth - #633
Merged
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 21, 2026 18:01
This was referenced Sep 22, 2026
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 changes
Desktop setup now shows real installation progress, preserves selections when going Back, and selects usable local ports instead of failing on occupied or Windows-reserved defaults. It also adds Google Gemini/xAI connections and lets users create a CopilotKit project during setup.
OAuth correctness
Windows Google and organization SSO callbacks restore blocking mode on accepted sockets and read a bounded complete request line, including delayed/fragmented requests.
Native sign-in and server refresh share an OS-owned lock. Refresh acquires it before spending a refresh token and holds it through durable replacement; process death releases ownership. An abandoned directory from an earlier PR build no longer prevents refresh or sign-in. Lock contention, failed request bodies, provider 403 and actual authentication failures have distinct sanitized outcomes, so quota/project denial does not send users through repeated sign-in.
xAI verification links must use the supported HTTPS accounts origin. Unused mailto capability is removed; configured organization/support links continue working. Credential-file and stream-failure guards have independent regressions and targeted mutation checks.
The proxy mounts only for a configured desktop credential file. Remote/Kubernetes deployments keep their existing ingress and authentication behavior. Bot calls retain the existing gateway and audit path; project authorization remains server-side. No new agent permission or shared server state.
Validation
CI is green on the database-recovery commit
5b70772b: 21 checks passed, including all three desktop builds, Windows standard-user setup and Python harness regressions; 3 conditional checks skipped. Native Clippy/binary build, desktop typecheck/lint/build, focused recovery regressions and real Podman recovery passed locally.The previous accepted CI run on
70fa9944was green: 21 passing checks and three conditional skips, including all three desktop builds, Windows standard-user setup and Python harness regressions. Prior accepted checks and real Mac workflows are retained; no new full provider browser sign-in on Windows is claimed by the targeted callback/storage checks.Distribution and limits
Google OAuth uses a registered desktop client and Cloud project quota, not a personal Gemini subscription. Artifact/signing workflows accept distributor client settings; this repository is configured for the approved internal client. Wider distribution still requires the appropriate consent/verification and quota setup. xAI follows its endorsed OpenCode public flow and supports a distributor client-ID override. Configuration/provenance is documented in desktop/PROVIDER_OAUTH.md.
Earlier unmerged PR test stacks must be stopped before switching lock protocols. No local lock can make a provider's remote token exchange and the subsequent disk write one atomic transaction; a crash in that remaining window can require sign-in. Tyler’s earlier Mac build error still lacks its underlying log line, so that specific build failure is not claimed as reproduced. Craig’s separate missing-key/leftover-volume startup report is addressed by the confirmed database recovery above.
Fixes FOR-320