Repository navigation
[Bug] Desktop app crashes on launch after macOS 27 upgrade (DesktopLocalEnvironmentAuthSessionBootstrapError) #12918
Description
Activity
Triage
Confirmed on current
main. This is a real launch-blocking desktop bug. Not a duplicate of #3513 (related brick path, different trigger). A fix PR is already open.What happens
Desktop launch bootstraps the primary local environment by exchanging the desktop bootstrap token for a bearer session, then probing
/api/auth/sessionfrom the renderer during rootbeforeLoad.On desktop that session call first asks the main process for a bearer token. The main process POSTs loopback
/oauth/tokenonce. A brief 503, connection reset, orTypeError(reported as more common after the macOS 27 upgrade) becomesDesktopLocalEnvironmentAuthSessionBootstrapErrorwith no retry.That failure is returned over IPC. The renderer wraps it as
PrimaryEnvironmentRequestError(fetch-session-state). The inner 503 is not visible after IPC, so the wrapper is labeled HTTP 500 andretryTransientBootstrapdoes not retry it.bootstrapServerAuth()awaits that firstfetchSessionState()outside its try/catch, so the throw escapesbeforeLoadandRootRouteErrorViewis shown.Relaunch can succeed once the backend has settled. After #11291, Try again re-runs
beforeLoadand may recover if the transient has cleared; it does not prevent the first-launch crash.Source
Crash chain:
apps/web/src/routes/__root.tsxbeforeLoad→resolveInitialServerAuthGateState()apps/web/src/environments/primary/auth.tsbootstrapServerAuth()→ unguardedfetchSessionState()apps/web/src/environments/primary/httpLayer.ts/desktopAuth.ts→getLocalEnvironmentBearerToken()apps/desktop/src/ipc/methods/window.ts→DesktopLocalEnvironmentAuth.getBearerTokenapps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts→ singlebootstrapRemoteBearerSession(no retry)packages/client-runtime/src/authorization/remote.ts+packages/client-runtime/src/rpc/http.ts→/oauth/token503/reset/TypeError
The cookie-exchange path in the renderer already retries 502/503/504 and degrades exchange failures to
requires-auth. The desktop bearer path does not.This is a desktop reliability gap, not a macOS-only code path. macOS 27 is the reported trigger (loopback timing while the backend settles).
Related
- Fix already open: fix(desktop): retry transient bearer bootstrap and degrade on session fetch failure #12919 (
Fixes #12918) — main-process transient retry on bearer bootstrap; renderer degrades a failed initial session fetch torequires-authinstead of crashing. - Related, keep open: [Bug]: Failed startup session probe bricks the app — fatal, sticky error in root beforeLoad with no recovery #3513 — broader “startup session probe bricks the app” issue (session-store writes, generic probe failure, diagnosability). [Bug] Desktop app crashes on launch after macOS 27 upgrade (DesktopLocalEnvironmentAuthSessionBootstrapError) #12918 is the specific no-retry bearer
/oauth/tokenslice. - Partial overlay recovery already on
main: fix(web): retry startup after the server recovers #11291 (Try again→router.invalidate()).
Suggested next step
Review/merge #12919. No second PR needed. After merge, this issue should close via the existing
Fixes #12918line. Leave #3513 open for the remaining degrade/diagnosability work.- addedacceptedfeature request acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
on Sep 21, 2026 Also hitting this on macOS 26.6.2 (25G83) with T3 Code 0.0.42, so it's not limited to macOS 27. Same chain on launch:
PrimaryEnvironmentRequestErrorcaused byError invoking remote method 'desktop:get-local-environment-bearer-token': DesktopLocalEnvironmentAuthSessionBootstrapError: Failed to create the local desktop bearer session.Error still in 0.0.45 - deleting everything and reinstall doesn't help, the app says "MacBook Pro is not connected." when trying to open a local folder as new project for a local environment.
Still hitting this on T3 Code (Nightly) 0.0.46-nightly.20261005.2702, macOS 27.0.1 (26A434), on a normal app restart. Same chain: PrimaryEnvironmentRequestError ← desktop:get-local-environment-bearer-token ← DesktopLocalEnvironmentAuthSessionBootstrapError. Relaunching recovered it. Looking forward to #12919 landing.
Area
apps/desktop
Steps to reproduce
pnpm build:desktop && pnpm start:desktop)./oauth/tokenexchange over loopback hits a transient failure (connection reset / brief 503 while the backend settles — newly common after the macOS 27 upgrade).beforeLoad.Expected behavior
The app boots to the chat view (or the pairing UI if unauthenticated), riding out the transient loopback failure.
Actual behavior
The app crashes to
RootRouteErrorViewwithPrimaryEnvironmentRequestErrorcaused byDesktopLocalEnvironmentAuthSessionBootstrapError: Failed to create the local desktop bearer session. No recovery path; relaunch may work if the transient condition has cleared.Impact
Blocks work completely
Version or commit
main(pre-fix)Environment
macOS 27.0 (Build 26A428), desktop app, Node v23.10.0
Logs or stack traces
Workaround
Relaunch after the transient condition clears. No in-app recovery.