You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fixes blank/loading secondary windows in multi-profile Desktop setups where opening a session by ID alone can connect the new renderer to the wrong profile/backend.
Related: this is part of the cross-profile Desktop session-resume cluster with #48473 (earliest open, registry-key mechanism), #49619 (route/profile-hint), and #59608 (?profile= URL hint). This PR combines the registry-key (${profile}:${sessionId}) and ?profile= URL-hint approaches. Not a duplicate of any single one — flagging the cluster so a maintainer can pick the canonical implementation.
Thanks for isolating a real multi-profile Desktop failure. Current main still omits profile ownership from the active secondary-window path: apps/desktop/electron/session-windows.ts:45-55 constructs URLs without a profile hint, apps/desktop/electron/main.ts:7359-7366 forwards only watch, and boot calls desktop.getConnection() before session refresh completes (apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts:434-479).
Problems
The submitted Electron changes target main.cjs and session-windows.cjs, which are absent on current main after 39d09453f95e8aefc0c97e5d9b30ff341cae9ed8; the active implementation is TypeScript.
The spectator path remains unhinted: apps/desktop/src/app/chat/composer/status-stack/index.tsx:107 passes only { watch: true }, and ComposerStatusItem has no profile (apps/desktop/src/store/composer-status.ts:16-32).
Suggested changes
Port the profile URL/IPC/boot changes to the active TypeScript paths and preserve fallback resolution for stale URLs.
Cover every secondary-window opener, including spectator windows, through one ownership-resolution strategy.
Add a current regression proving the first secondary-window connection uses the URL profile hint before route resume.
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
area/profilesMulti-profile isolation, HERMES_HOME scopingarea/sessionsSession lifecycle, resume, persistence, historycomp/desktopElectron desktop app (apps/desktop/*)P2Medium — degraded but workaround existssweeper:blast-moderateSweeper blast radius: moderate — a subsystem or single platformsweeper:risk-compatibilitySweeper risk: may break existing users, config, migrations, defaults, or upgradessweeper:risk-session-stateSweeper risk: may lose/corrupt/mis-associate session or context statetype/bugSomething isn't working
3 participants
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.
Summary
Test plan
node apps/desktop/electron/session-windows.test.cjsnpm --workspace apps/desktop exec -- vitest run --environment jsdom src/store/windows.test.ts src/store/profile.test.ts src/app/session/hooks/use-route-resume.test.tsxnpm --workspace apps/desktop run typechecknpm --workspace apps/desktop run buildNotes
This fixes blank/loading secondary windows in multi-profile Desktop setups where opening a session by ID alone can connect the new renderer to the wrong profile/backend.