fix(desktop): preserve profile for session windows - #48473
Conversation
a60a639 to
9b27313
Compare
|
Rebased this PR onto current Kept both behaviors:
Validation: |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing the profile identity through the pop-out flow. The underlying bug remains on current main: both pop-out entry points discard session.profile (apps/desktop/src/app/chat/sidebar/session-row.tsx:174, session-actions-menu.tsx:129), and Electron opens the window with only watch (apps/desktop/electron/main.ts:7424-7431).
Problems
- The submitted route-resume change is too late for cold boot: route resume waits for
gatewayState === 'open'(apps/desktop/src/app/session/hooks/use-route-resume.ts:111-150), while the PR does not make the initial gateway connection profile-aware. The boot path must consume the URL hint before connecting so a window does not depend on the default profile starting first. - The PR targets superseded CJS and pre-split hook paths. Current main uses
apps/desktop/electron/main.ts,apps/desktop/electron/session-windows.ts, andapps/desktop/src/app/session/hooks/use-session-actions/. - Please remove the root-level
hermes-desktop-session-window-profile-scope-pr.md; it duplicates the PR description.
Suggested changes
- Port the flow to the current TypeScript paths, seed gateway boot from the validated URL profile, and test the first connection plus profile-qualified window reuse.
Automated hermes-sweeper review.
| @@ -1047,6 +1048,7 @@ export function DesktopController() { | |||
| resumeSession, | |||
There was a problem hiding this comment.
routeProfile reaches resume only after the gateway is open. Please also consume this secondary-window hint during gateway boot: otherwise a window must first connect to the default profile, and a default-profile boot failure prevents this resume path from running.
| @@ -0,0 +1,23 @@ | |||
| ## Summary | |||
There was a problem hiding this comment.
Please remove this repository-root PR-summary artifact. The PR body already documents the change, and this file is neither runtime documentation nor regression coverage.
9b27313 to
6f47d9d
Compare
|
Updated the branch onto current main and addressed the review feedback. Changes:
Validation:
|
|
I reproduced the remaining spectator-window variant on current Current |
Summary
Pass the owning profile through desktop secondary session windows so opening a stored session in a new window resumes it against the correct profile context.
Previously,
openSessionInNewWindow()only forwardedsessionIdandwatch, while the secondary-window URL and route-resume path had no profile hint. That meant a pop-out window could fall back to the active/default profile during cold resume, which is wrong for profile-scoped sessions.Changes
profilefrom session-row and session-actions-menu into the desktop bridge.profile=in the secondary-window URL before the hash route.Tests