Skip to content

feat(desktop): support opening sessions in multiple windows#40499

Open
izumi0uu wants to merge 1 commit into
NousResearch:mainfrom
izumi0uu:feat/desktop-multi-window-40394
Open

feat(desktop): support opening sessions in multiple windows#40499
izumi0uu wants to merge 1 commit into
NousResearch:mainfrom
izumi0uu:feat/desktop-multi-window-40394

Conversation

@izumi0uu
Copy link
Copy Markdown

@izumi0uu izumi0uu commented Jun 6, 2026

What does this PR do?

Adds first-pass multi-window support to Hermes Desktop so the app can open the same profile in multiple independent windows.

This keeps the existing shared desktop/backend model and extends the Electron shell to manage multiple BrowserWindow instances. It adds the entry points requested in the issue (File > New Window, Cmd/Ctrl+Shift+N, and a session context-menu action), then makes window-targeted IPC and window-scoped UI state work correctly for those extra windows.

Because multiple windows can resume the same stored session at different times, this PR also refreshes cached session state from stored messages on resume and when a window regains focus. That keeps a second window from showing a stale transcript after another window has continued the conversation.

Related Issue

Fixes #40394

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • manage multiple desktop BrowserWindow instances in apps/desktop/electron/main.cjs
  • add File > New Window, Window > New Window on macOS, and Cmd/Ctrl+Shift+N
  • add Open in New Window to the session sidebar actions menu
  • expose a route-aware openWindow() desktop bridge through preload.cjs
  • route Electron IPC responses and window state updates to the correct target window
  • refresh cached session transcripts from stored messages on resume and on window focus so another window can see the latest conversation state
  • add targeted tests for the new session action and cached-session rehydrate behavior

How to Test

  1. From apps/desktop, run npm run type-check.
  2. From apps/desktop, run npx vitest run src/app/chat/sidebar/session-actions-menu.test.tsx and npx vitest run --environment jsdom src/app/session/hooks/use-session-actions.test.tsx.
  3. Launch Hermes Desktop on macOS, then verify:
    • File > New Window opens a second desktop window
    • Cmd+Shift+N opens another window
    • right-clicking a session and choosing Open in New Window opens that session in a separate window
    • continuing a session in one window is reflected after resuming/focusing that same session in another window

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.7.7

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

N/A

@izumi0uu izumi0uu marked this pull request as ready for review June 6, 2026 12:56
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have labels Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support opening multiple independent desktop windows

2 participants