Skip to content

fix(desktop): isolate new-session windows - #67049

Open
deniqlab wants to merge 1 commit into
NousResearch:mainfrom
deniqlab:fix/65601-new-session-window-isolation
Open

fix(desktop): isolate new-session windows#67049
deniqlab wants to merge 1 commit into
NousResearch:mainfrom
deniqlab:fix/65601-new-session-window-isolation

Conversation

@deniqlab

Copy link
Copy Markdown
Contributor

Closes #65601\n\n## Summary\n- Skip remembered-route/session restoration in standalone new-session windows\n- Add a regression test proving the window stays on /new instead of jumping to the last session\n\n## Verification\n- npm run test:ui -- --run src/app/contrib/hooks/use-desktop-integrations.test.tsx\n- npm run typecheck\n- npx eslint src/app/contrib/hooks/use-desktop-integrations.ts src/app/contrib/hooks/use-desktop-integrations.test.tsx\n- git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working duplicate This issue or pull request already exists comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #66270: both prevent standalone new-session windows from restoring or persisting the remembered route/session state.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused regression fix. Current main has the reported path: apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts:64-72 persists shared remembered state, then :79-100 restores it when the renderer starts at /. Electron deliberately starts standalone drafts at ?win=secondary&new=1#/ (apps/desktop/electron/session-windows.ts:45-47), and isNewSessionWindow() already recognizes that flag (apps/desktop/src/store/windows.ts:33-49).

The patch gates both effects and the regression test exercises the hook with a new-session window, asserting that neither remembered-state reads/writes nor navigation occur. The current hook blob matches the PR preimage, so salvage is mechanically clean.

Automated hermes-sweeper review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/desktop Electron desktop app (apps/desktop/*) duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop new session window reuses existing agent context — no session isolation

3 participants